Good Day
I have what seems to be a common issue in forums but I am unable to find a suitable solution.
I have attached the DB created and posted by a forum user (sorry I cant track where I got it from)
The database comprises of a search form that dynamically creates a search filter and then updates the subform based on the multiple filter criteria based on the main form fields.
I now wish to apply this filter and print a report based on these same filtered results.
--------------------------------------------------------------------------------------------
The Search Button code looks like this.
Private Sub btnSearch_Click()
' Update the record source
Me.frmsubClients.Form.RecordSource = "SELECT * FROM qryClientData " & BuildFilter
' Requery the subform
Me.frmsubClients.Requery
End Sub
--------------------------------------------------------------------------------------------
On the PrintPreview button I would like to try something like:
Private Sub btnPrintPreview_Click()
DoCmd.OpenReport "rptClients", acViewPreview, #insert the WHERE filter here if possible based on the same smple code as above#
End Sub
I have tried plenty of unsuccessful attempts and would really appreciate your input.
Many Thanks