GodofSmallThings
MIS
Hello,
I would like to preview a report based on an Option group
selection. The selection is based on [CATEGORY] from my
report. The report is generated from a query...
The following is code from the Command button on my Preview
Menu Form:
Private Sub btnPreviewReport_Click()
On Error GoTo Err_btnPreviewReport_Click
Dim stDocName As String
Dim stFilter As String
stDocName = "rptPaper"
stFilter = ""
Select Case Preview
Case 1
stFilter = "[CATEGORY] = 'PREMIUM' "
Case 2
stFilter = "[CATEGORY] = 'SURVEY' "
Case 3
stFilter = "[CATEGORY] = 'DAVIDS' "
End Select
DoCmd.OpenReport stDocName, acViewPreview, , stFilter
Exit_btnPreviewReport_Click:
Exit Sub
Err_btnPreviewReport_Click:
MsgBox Err.DESCRIPTION
Resume Exit_btnPreviewReport_Click
End Sub
When I click on the command button. The entire report
displays and not the filtered selection. Your assistance
would be appreciated. Thanks in advance...
I would like to preview a report based on an Option group
selection. The selection is based on [CATEGORY] from my
report. The report is generated from a query...
The following is code from the Command button on my Preview
Menu Form:
Private Sub btnPreviewReport_Click()
On Error GoTo Err_btnPreviewReport_Click
Dim stDocName As String
Dim stFilter As String
stDocName = "rptPaper"
stFilter = ""
Select Case Preview
Case 1
stFilter = "[CATEGORY] = 'PREMIUM' "
Case 2
stFilter = "[CATEGORY] = 'SURVEY' "
Case 3
stFilter = "[CATEGORY] = 'DAVIDS' "
End Select
DoCmd.OpenReport stDocName, acViewPreview, , stFilter
Exit_btnPreviewReport_Click:
Exit Sub
Err_btnPreviewReport_Click:
MsgBox Err.DESCRIPTION
Resume Exit_btnPreviewReport_Click
End Sub
When I click on the command button. The entire report
displays and not the filtered selection. Your assistance
would be appreciated. Thanks in advance...