Hi there,
I am using the following code to filter a report
Private Sub cmdOpCompanyName_Click()
Dim reportname As String
reportname = listReports.Value
' this opens the report in preview mode and you select the customer using the single quotes because Me.cboCompanyName
' returns text and text needs to be surrounded by quotes.
DoCmd.OpenReport reportname, acViewPreview, , "[TutorName]='" & Me.cboCompanyName & "'"
End Sub
The user selects the report from listReports. What I need the code to do though is if the report selected does not contain the filter item i.e TutorName then display message box saying that this report does not contain the filter item.
I am using the following code to filter a report
Private Sub cmdOpCompanyName_Click()
Dim reportname As String
reportname = listReports.Value
' this opens the report in preview mode and you select the customer using the single quotes because Me.cboCompanyName
' returns text and text needs to be surrounded by quotes.
DoCmd.OpenReport reportname, acViewPreview, , "[TutorName]='" & Me.cboCompanyName & "'"
End Sub
The user selects the report from listReports. What I need the code to do though is if the report selected does not contain the filter item i.e TutorName then display message box saying that this report does not contain the filter item.