Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Link a Report to a single form record.

Status
Not open for further replies.

jbelf

MIS
May 14, 2003
12
0
0
AU
Hi,

Anyone know how I could link a report to a single record? For example, when scrolling through records on a form, I'd like to launch a report that contains information from that single record.

I created my report, but it currently is linked to the table, and as a result, brings up all records. I need it to query and report only the record that is currently on display.

Any thoughts?

Thanks!
 
Having the table as the Record Source shouldn't be a problem. What you need to do is use the OpenReport Method in the click event for a button. That will allow you to put in a Where argument that will filter the Report to the single record. It looks something like this
DoCmd.OpenReport "ReportName",acViewPreview,,"PrimaryKey = '" & Forms!FormName!PrimaryKeyName & "'"

Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top