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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

opening a form or a report to a specific record.

Status
Not open for further replies.

esromneb

Programmer
Mar 30, 2002
76
US
Hi, I'm new to access and I'm trying to build a freight forwarding tracking database. The problem that I keep running in to is that I can't open a form or a report to a specific record. Rather I have to link to the form and then scroll to the record I want. Thanks very much.
 
Here is code for a command button on a form to print a report from the form that you are on:

You need to make sure you have a auto number field set up called something like "ID". That way a specific number would be tied to a specific record, thus retrieving the record you need to preview or print:

DoCmd.OpenReport "rpt_Report1", acViewPreview,, "[ID]=" & Forms![frm_Form1]![ID]

Hope this helps,

Jerome Benton
JERPAT Web Designs
GOD Is Good All The Time!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top