Printing a batch of reports if given a list of ID's

  • Thread starter Thread starter mgolding
  • Start date Start date
M

mgolding

I have a report that lists a person's contact information that's
already performing nicely. The report opens when I feed it a single
contactID from a form.

Now, I want to reuse the report by feeding in a list of contactID's and
printing the report for each one. How do I go about this?

--Megan Golding
 
Do you use a filter when you open the report? Something like:
DoCmd.OpenReport "ReportName", acViewPreview, , "ContactId = " &
Me.ContactID

To pass more than one you could change it to:
DoCmd.OpenReport "ReportName", acViewPreview, , "ContactId IN(" &
Me.ContactID & ")"

You would need to separate the IDs with commas. The statement will
also work even if the user only enters a single contactID.

Hope that helps!
 
Back
Top