Limiting Report Records

G

George B.

I have a library catalog form with a print report
button. However, I want the catalog report to only print
the current record onscreen when the button is clicked.
I've looked at the CurrentRecord Property, OpenArgs, etc.
and it confuses me. Any help will be greatly
appreciated. Thanks! George
 
J

Jonathan Parminter

-----Original Message-----
I have a library catalog form with a print report
button. However, I want the catalog report to only print
the current record onscreen when the button is clicked.
I've looked at the CurrentRecord Property, OpenArgs, etc.
and it confuses me. Any help will be greatly
appreciated. Thanks! George
.
Hi George,
ensure that each record has a unique primary key or id.
For example BookID.
the code to print the current book displayed on the form
is:

docmd.openreport "rptReportName",acPreview,,"[BookID]=" &
BookID

BookID does not have to be a field on the form, so long as
this field is in the form record source.

Luck
Jonathan
 

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