You'd put that wherever you're trying to open the report, be it on the Click
event of a command button, or some other event.
All the first 3 lines are doing is ensuring that the record is saved if
there are still pending changes to it. The 4th line simply passes a filter
to the report when it's opening it. (You do realize, I hope, that you need
to change "Name of Report",[InvoiceID] and Me!InvoiceID to whatever names
are appropriate in your case)
If you've done all that and it's not working, show us the actual code you're
using, and let us know what the symptoms are. Are you getting an error? If
so, what's the error. Is the report opening, but not being filtered?
--
Doug Steele, Microsoft Access MVP
(no e-mails, please!)
Steve Moss said:
Thinking I was clever I tried to use the code you provided Joan. It soon
came apparant that I was actually not as clever as I hoped. Could you
please
tell me where to insert the code.
Many Thanks
Steve (The not so clever)
Joan Wild said:
If Me.Dirty Then
Me.Dirty = False
End If
DoCmd.OpenReport "Name of Report", , , "[InvoiceID] = " & Me!InvoiceID
--
Joan Wild
Microsoft Access MVP
Steve said:
I have a main for, with a subform attached. The combination of the
two, when populated creates an Invoice report. Unfortunatly when I
view the Report, it includes all the invoice Reports page after page.
How can I limit what I am looking at to only the active Invoice
displayed on my form. Hope that makes sense.
Cheers
Steve