Calling Sub from Macro

B

Boon

Hello,

I have a Sub in my Module.

e.g.

Sub Test()
dim temp variant

temp=msgbox("hello")

End Sub


How can I call this Sub in a Macro?


thanks.
 
D

Douglas J. Steele

What version of Access?

In Access 2003 and earlier, you need to change Test from a Sub to a Function
(it doesn't matter whether the function returns a value or not)

In Access 2007, I believe you can run Subs, but you need to ensure that
you've got the button depressed to Show All Macros.
 
B

Boon

I am using 2007.

I cannot run the Subs in 2007. at least I don't know how. There is only
"RunCode" in the macro command. I did show ALL Macros.

anyway, I use your suggestion for 2003 and it works fine.

thanks!
 

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