S
SAVLO
I have created an option group on a form with 4 buttons all are pointing to a
report. 3 are working properly Option 4 invokes a list box for a user to
choose an particular group to include in the report. I believe there needs
to be something in the properties of the report but I’m not sure what. All
reports are generated by a series of queries. Can anyone help?
The following is the code I used:
Dim strWhereSelectGroup As String
strWhereSelectGroup = "[Asset Group].GroupDescription =
Forms![Print/Preview]!SelectGroup"
Select Case Me!ReporttoPrint
Case 1
DoCmd.OpenReport "Cost per Hour 1st Quarter 2007", PrintMode
Case 2
DoCmd.OpenReport "Hourly Cost by Category", PrintMode
Case 3
If IsNull(Form![Print/Preview]!SelectGroup) Then
DoCmd.OpenReport "Hourly Cost by Group", PrintMode
Else
DoCmd.OpenReport "Hourly Cost by Group", PrintMode, ,
strWhereSelectGroup
End If
Case 4
DoCmd.OpenReport "Cost per Hour by Cost Center", PrintMode
End Select
report. 3 are working properly Option 4 invokes a list box for a user to
choose an particular group to include in the report. I believe there needs
to be something in the properties of the report but I’m not sure what. All
reports are generated by a series of queries. Can anyone help?
The following is the code I used:
Dim strWhereSelectGroup As String
strWhereSelectGroup = "[Asset Group].GroupDescription =
Forms![Print/Preview]!SelectGroup"
Select Case Me!ReporttoPrint
Case 1
DoCmd.OpenReport "Cost per Hour 1st Quarter 2007", PrintMode
Case 2
DoCmd.OpenReport "Hourly Cost by Category", PrintMode
Case 3
If IsNull(Form![Print/Preview]!SelectGroup) Then
DoCmd.OpenReport "Hourly Cost by Group", PrintMode
Else
DoCmd.OpenReport "Hourly Cost by Group", PrintMode, ,
strWhereSelectGroup
End If
Case 4
DoCmd.OpenReport "Cost per Hour by Cost Center", PrintMode
End Select