Creating a report for 1 record from a query

G

Guest

I have a report that prints all records from a particular query, but I'm
wanting to print just 1 record. Sorta like selecting a company that has
multiple invoices, but only wanting to print 1. Can somebody help me?

Thanks.
 
G

Guest

Hi Rpainter,

You could either have your query so that it uses the ID in the criteria
field, or open your report like this:

docmd.OpenReport "REPORTNAME", acViewPreview,,"ID = 3"

Hope this helps.

Damian.
 
D

Douglas J. Steele

It's a WHERE clause (without the word WHERE) that limits the report to only
those records that match the condition.

It could be a variable:

Dim strFilter As String

strFilter = "ID = 3"
DoCmd.OpenReport "REPORTNAME", acViewPreview,,strFilter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top