Run Macro in VBA help (1 Viewer)

AnnPhil

Registered User.
Local time
Today, 01:46
Joined
Dec 18, 2001
Messages
246
Hopefully this is a simple fix for someone who runs macros in access modules.

I have code tied to a Print button that prints a different report based on which one the user selects, one of them needs a macro to run in order to generate report so i wrote this line of code for the one that needed a macro to run.

DoCmd.RunMacro SpendingReportsMacro_County

It runs the macro fine but then an error message comes up on the screen that says "The action or method requires a Macro Name argument"

Why does this message come up? What am i missing here?

Thanks for any help
 

ajetrumpet

Banned
Local time
Yesterday, 19:46
Joined
Jun 22, 2007
Messages
5,638
what is the syntax for the docmd.runmacro command? Have you filled in all the required sections of it? Does the macro name need to be enclose in quotes to indicate a string?
 
M

Mike375

Guest
Adam,

You had it right.

DoCmd.RunMacro "Macro340", , ""

That is a copy and paste for one of mine.
 

Users who are viewing this thread

Top Bottom