Print all records on Form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am having a problem. I created a main form that filters many different
options and then opens another form. From there the user can double click
any record to get more detail, but I would like to also give them the option
to print only the records on the form as well in a report. But everytime I
click the button to print the report all the records from the query print.
Not just my filtered records.

Can anyone help me? Thanks!
 
You can apply the form's filter to the report by putting code like this in
the Click event procedure of a command button on your form:
Dim strWhere As String
If Me.Dirty Then Me.Dirty = False
If Me.FilterOn Then strWhere = Me.Filter
DoCmd.OpenReport "Report1", acViewPreview, , strWhere
 
Back
Top