Running Visual Basic Code Using ^Z

D

Dave

How can I run visual basic code using a macro? I plan on assigning a shortcut
key (control Z) to run visual basic code. I do not want to us a command
button. The first line of code is "Private Sub CommandCode_Click()". (It was
created using a command button).
 
K

Klatuu

Use the RunCode action in your macro and give it the name of your function.
I notice your code is a Sub. Macros can only run functions, so change it to
a function and put it in a standard module. Becareful which key you use. If
you assign a key that Access uses for something else, you will disable that
capability.
 
D

Dave

Thank You.

Klatuu said:
Use the RunCode action in your macro and give it the name of your function.
I notice your code is a Sub. Macros can only run functions, so change it to
a function and put it in a standard module. Becareful which key you use. If
you assign a key that Access uses for something else, you will disable that
capability.
 
Top