2 out of 13 rated this helpful - Rate this topic

How to: Filter a Report Using a Form's Filter

Office 2007

The following example illustrates how to open a report based on the filtered contents of a form. To do this, specify the form's Filter property as the value of the OpenReport method's WhereCondition argument.

Private Sub cmdOpenReport_Click()
    If Me.Filter = "" Then
        MsgBox "Apply a filter to the form first."
    Else
        DoCmd.OpenReport "rptCustomers", acViewReport, , Me.Filter
    End If
End Sub


Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.