Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

run macro from VBA code

Status
Not open for further replies.

qwertyjjj

Programmer
May 27, 2005
70
GB
I have a macro saved under the Accss Macros menu.
I am trying to run this from VBA code through an onClick event.

I realise you can select the macro directly but I need to put in some code for other stuff so I'm directing it to run the code instead.
I use DoCmd.RunMacro(MacroName)

It doesn't seem to find the macro for some reason.
Do I have to add more parameters to the macroname bit ?
 
It is:
[tt]DoCmd.RunMacro "MacroName"[/tt]
As far as I recall. This name can sometimes be in the form "Macro1.OtherName", where macros have been grouped.

However, now seems a good time to save this macro as code, and just continue from there.


 
How are ya qwertyjjj . . .

Be sure to enclose the macroname in quotations:

"macroname"

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top