Macro

Franky G

Registered User.
Local time
Today, 17:57
Joined
Feb 6, 2001
Messages
62
Hi,

I'm modifying someone else's macro do to what I want.

At the moment, the autoexec macro opens and prints report 1, then report 2 and then closes access. I would like to give the user the option of whether to continue with Report 2 or quit.

If there are 3 reports, how would I give options to run reports 2 and 3. (Report 1 will always be run)?

hope that makes sense,

Thanks

Frank
 
Few options here either use condition in Macro or use code which you can then call through RunCode in Autoexec.

1) Using condition
Create a second Macro to print the second and subsequent reports if user answers Yes. Change autoexec to have condition, within Design click View Conditions.
Autoexec will thus have
1st line: OpenReport - Print Report1
2nd line: condition of MsgBox("Print other reports?",4,"Continue or Quit?") = 6
RunMacro - Macro to print Report2 & 3, etc
3rd line - Quit access

Code: Use the following if statement in a function which you can call from autoexec using RunCode FunctionName()
if MsgBox("Print other reports?",vbyesno,"Continue or Quit?") = 6
Print reports
else
quit access
end if
 

Users who are viewing this thread

Back
Top Bottom