My situation - I have a form [frmReport] which has a subform [frmSubReport] which is set to datasheet view. The subform displays select data from all records, I did attempt to use a listbox, but found that the subform setup is easier for sorting & filtering.
My issue is this, I have a print button on the form which when clicked I want to display my report with the all records or if a filter is applied display to filtered records. I'm using to following code:
It does work however when I apply a filter and close the report, the next time I go to run a report say of all the records the previous filter is still there. What am I missing?
Private Sub cmdPrintPreview_Click()
DoCmd.OpenReport "rptRequestSummary", acViewPreview, , Me.frmSubReport.Form.Filter
Sorry if this is basic but I'm pretty new to this and don't know the ins and outs of VBA, I'm still pinching and modifying code off the net.
I'm using 2007 if that makes a difference.