
This form is based on the customers table from the Northwind sample database. The country field has been filtered to show only those customers located in Germany.
Now, place the following code behind the Preview Report button's On Click event:
DoCmd.OpenReport "rptCustomers", acPreview, , IIf(Me.FilterOn = True, Me.Filter, "")
Now, once the user clicks on the the Preview Report button, the report uses the filter property of the form, if a filter has been set.


This report is now filtered using the same filter used on the form.
No comments:
Post a Comment