Open and Preview a Single Record in a Report

  • Thread starter Thread starter Brian T
  • Start date Start date
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
 
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
 
Back
Top