Run Code with a Function Key

Clepto

Registered User.
Local time
Today, 05:48
Joined
May 12, 2012
Messages
35
I am sure there is a function key to run a VBA module [Private Sub X() ] but I can’t remember what it is. I set up a module to print some labels to screen, many months ago, and I am sure I ran it in this way. I have come back to the database and there are no macros or Subs to run this code any other way, so I’m sure I ran it from within the code module. I think it might have been Ctrl F12 or some such, but I can’t find any reference to it through a Google search.

I can step through the module with F8, so there is no problem there. I even call a delay function to hold each label on the screen, so that I can check them as the code runs. F8 steps to the code for this function, so you don't get to see the label.

Am I going mad? Was it all a dream?
 
there ARE other ways to run code: macros, buttons
but you can set the form props:
keypreview = true
and in the event KEYDOWN:
If KeyCode = vbKeyF3 Then RunCode()
 
Thanks for that, but if I did it that way, I would still have the forms and macros and there are none. As I recall, I set the cursor after the () on the first line of the sub pressed a button or combination of same and it ran.
 
in the vba code window for standard modules (not form modules) put the cursor on a valid code line and hit F8 - code will run to this point. Hitting F8 again will step one line through the code. Alternatively hit F5 to just run the code - don't know if this works for macros.
 
try autokeys macros.

you can assign numerous ctrl keys to functions.

you cannot do this any other way.

autoexec macro , and autokeys macro are the only macros I use.
 

Users who are viewing this thread

Back
Top Bottom