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.OpenRepor t ReportName:="Re port", View:=acViewRep ort, WhereCondition: ="SearchQSubfor m.Filter"
Here are the details of the database:
Main Form Name: "SearchForm s:
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.OpenRepor t ReportName:="Re port", View:=acViewRep ort, WhereCondition: ="SearchQSubfor m.Filter"
Here are the details of the database:
Main Form Name: "SearchForm s:
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.
Comment