Running Visual Basic Code Using ^Z

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).
 
G

Guest

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.
 
G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top