Running Visual Basic Code Using ^Z

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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).
 
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.
 
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.
 
Back
Top