Open and Preview a Single Record in a Report

B

Brian T

I have a report where I would like to open and print only the chosen record.
How to I specify the record?

Thanks
 
B

Brian T

Thanks, but is there a way to write the same thing into an embedded macro?

Marshall Barton said:
Brian said:
I have a report where I would like to open and print only the chosen record.
How to I specify the record?


If you have a form where users can navigate to the desired
record, then add a command button to open the report. The
code behind the button would look something like:

Dim stWhere As String
stWhere = "[primary key field]=" & Me.[primary key field]
DoCmd.OpenReport "report name", acviewPreview, , stWhere
 

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