Tamille2020
New member
- Local time
- Today, 04:35
- Joined
- Feb 22, 2022
- Messages
- 4
My end user is using a filter on a sub-form (SearchQSubform) then pressing the "PrintPDF" button that is located on the form (SearchForms). However, all the searched data in the sub-form is printing. I only wish to print the user's filtered data. I tried putting the following code in the "On Click" event procedure for the "PrintPDF" button:
Private Sub PrintPDF_Click()
DoCmd.OpenReport ReportName:="Report", View:=acViewReport, WhereCondition:="SearchQSubform.Filter"
Here are the details of the database:
Main Form Name: "SearchForms:
Sub-form Name: "SearchQSubform"
The Query the sub-form is based on: "SearchQ"
Name of the report to be viewed/printed: "Report"
What am I doing wrong? Please help.
Private Sub PrintPDF_Click()
DoCmd.OpenReport ReportName:="Report", View:=acViewReport, WhereCondition:="SearchQSubform.Filter"
Here are the details of the database:
Main Form Name: "SearchForms:
Sub-form Name: "SearchQSubform"
The Query the sub-form is based on: "SearchQ"
Name of the report to be viewed/printed: "Report"
What am I doing wrong? Please help.