Setup an Option Group with external Cmds

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
 
D

Duane Hookom

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)
 

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