B
Bobby.Dannels
I have a form with lstReports displaying all reports in my database.
cboFilter is a combo box with a list of sections (a field in all
reports). I am trying to Filter all reports by the section selected in
the cboFilter. This is the code I am using. Please help.
Private Sub chkPreview_Click()
On Error GoTo Err_chkPreview_Click
Dim stDocName As String
stDocName = Me.lstReports
If Me.cboFilter <> "" Then
DoCmd.OpenReport stDocName, acViewPreview, , "Section =
Me.cboFilter.Value"
Else
DoCmd.OpenReport stDocName, acViewPreview, selectsection
End If
Exit_chkPreview_Click:
Exit Sub
Err_chkPreview_Click:
MsgBox Err.Description
Resume Exit_chkPreview_Click
End Sub
cboFilter is a combo box with a list of sections (a field in all
reports). I am trying to Filter all reports by the section selected in
the cboFilter. This is the code I am using. Please help.
Private Sub chkPreview_Click()
On Error GoTo Err_chkPreview_Click
Dim stDocName As String
stDocName = Me.lstReports
If Me.cboFilter <> "" Then
DoCmd.OpenReport stDocName, acViewPreview, , "Section =
Me.cboFilter.Value"
Else
DoCmd.OpenReport stDocName, acViewPreview, selectsection
End If
Exit_chkPreview_Click:
Exit Sub
Err_chkPreview_Click:
MsgBox Err.Description
Resume Exit_chkPreview_Click
End Sub