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
 
Top