
Using the AutoKeys Macro Group as a Developer
Often, as I develop a procedure, I will add a few lines at a time to the procedure, and then test it to see if the outcome is as expected. Normally, if you are typing in the main procedure, you can just use the 'F5' key. However, when you are working in a procedure that can only be called by another procedure, it means that you have to move to the correct part of the module in order to be able to run it this way.
Instead of this, I often create an AutoKeys macro group that runs the main procedure using a single key press. For example, if the main procedure is a function (note that you cannot run a subprocedure from a macro) called fTest(), and I want to assign it to the F5 keypress:
- Create a new macro;
- In the Macro Name column, type {F5};
- In the Action column, select RunCode;
- In the Function Name argument that appears at the bottom of the screen, either type the name of the Function, i.e. fTest() or else use the Expression Builder to select the function;
- Save the macro as AutoKeys
Now, whenever you press the F5 key in this database, you will run the procedure called fTest. Additionally, I will often add to the macro a Save action to force the module to be saved before running the code, instead of having to press Ctl-S as well (I know that I'm lazy, but whenever I forget to save the module, I usually end up crashing out of Access and losing any alterations made since the last time the module was saved.
However, when you have finished testing that particular procedure, make sure that you remove this AutoKeys macro!!
Top
HOME |
NEW |
TABLES |
QUERIES |
FORMS |
REPORTS |
GENERAL |
API |
DOWNLOADS |
TUTORIAL |
RESOURCES
E-MAIL
Copyright & Disclaimer
|