Here's how you do it. First, use the wizard to create an option group. It'll prompt you to type in a label for each report. Make sure you write those down alongside the number assigned to it--you'll need them to refer to later on. Then create a button for either Print or Preview (or a button for each).
Right click on one of button for the shortcut menu and choose Properties. Click the Event tab. For the On Click option, chose Event Procedure. Click the ... button next to that to go the visual basic window. Add the following code in:
Private Sub cmdPreview_Click()
On Error GoTo ErrorPreview
Select Case [fraPrint]
' Each of these case numbers represent an item in the option group. Insert the report that matches the corresponding number
Case Is = 1
DoCmd.OpenReport "rptName1", acViewPreview
' For sending the report directly to the printer, use acViewNormal instead of acViewPreview
Case Is = 2
DoCmd.OpenReport "rptName2", acViewPreview
Case Is = 3
DoCmd.OpenReport "rptName3", acViewPreview
Case Is = 4
DoCmd.OpenReport "rptName4", acViewPreview
End Select
ExitPreview:
Exit Sub
ErrorPreview:
Msgbox err.Description
Resume ExitPreview
End Sub
Linda Adams
Visit my web site for writing and Microsoft Word tips:
Official web site for actor David Hedison: