Setup an Option Group with external Cmds

  • Thread starter Thread starter Dave
  • Start date Start date
D

Dave

I have an option group of 6 outside the frame there are 3 Cmd boxes ie,
print, preview, close.

I simply wish to preselect an option and Then click either say a "Print" or
"Preview", "Send" etc (or for that matter cancel).

I have the option group set up, the Cmd boxes etc, But how do I get say the
"Print" Cmd to print the preselected (report), say option 2 etc.??

Any help will be greatly appreciated
Dave
 
Your code might look something like:

Public Function ReportIt( intMode as Integer)
Dim strReport as String
Select Case Me.optGroupRpt
Case 1
strReport = "rptA"
Case 2
strReport = "rptB"
Case 3
strReport = "rptC"
--- etc ---
End Select
DoCmd.OpenReport strReport, intMode
End Function

Then set the On Click event property (not code) of the preview command
button to
On Click: =ReportIt(2)
The On Click property of the Print command button would be:

On Click: =ReportIt(0)
 
Back
Top