call to a macro in a module

krc777

Registered User.
Local time
Yesterday, 22:44
Joined
Nov 29, 2005
Messages
70
I created a macro (OpenAllrpts) that opens 7 reports. In the argument section I have listed the name of the report and Print preview.
In the code behind the form the user will use I have docmd.runmacro OpenAllrpts. I'm getting an error that an argument is needed. What do I do?
 
in general you want to use VBA instead of Macros, because the errors reported are much easier to understand. in order to get an answer in here i think you should somehow explain whats goin on.

good luck,

sam
 
Agreed. I would try to steer clear from macro's just for the benefit of being able to troubleshoot better.

Why not in a module use:
DoCmd.OpenReport "Reportname", acViewPreview

and then just call the module in the page, say you have a button for them to press, choose a onclick event. In that event just type Call ModuleName.

or even still rather than a module, just put the above code on the form under the onclick option of the button.
 
I think you need to surround OpenAllReports in quotes "OpenAllReports"
 

Users who are viewing this thread

Back
Top Bottom