Print Report A or B depening on Yes or No

V

vanicu

Hi,

Can anyone show me how to program a print button? I want
this button to print report 'B' if checkboxX is equal to
YES and to print report 'A' if checkboxX is equal to NO.

Do I need a script, I have no clue.

Thank You

Vince
 
T

tina

from the command button's OnClick event, you can run an
event procedure, as

If Me!CheckboxX Then
DoCmd.OpenReport "Report B"
Else
DoCmd.OpenReport "Report A"
End If

or a macro, as

Condition Action Action Arguments
CheckboxX = True OpenReport Report Name: Report B
.... StopMacro
OpenReport Report Name: Report A

hth
 
G

Gary Miller

Vince,

Here is a code snippet that will do that for you although
you will need to add the appropriate print parameters to the
OpenForm command.

If Me!checkboxX = True Then
DoCmd.OpenReport "B", '(Fill in your parameters here)
Else
DoCmd.OpenReport "A", '(Fill in your parameters here)
End If
--

Gary Miller
Gary Miller Computer Services
Sisters, OR
________________________
"(e-mail address removed)" <[email protected]>
wrote in message
news:[email protected]...
 

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