Print Report A or B depening on Yes or No

  • Thread starter Thread starter vanicu
  • Start date Start date
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
 
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
 
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]...
 
Back
Top