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

Trying to obtain a single report from form page

Status
Not open for further replies.

julius1

Technical User
Oct 31, 2002
142
US
Need a tip.
I have a form that pulls up a distinct record to edit and update. When I click the email report button to send the edited record I was working on it pulls up every record in the database. How can I just get that one record on the report?
 
The email report button should be calling the report with a condition (where clause). For example, if you were just printing the report you would:

DoCmd.OpenReport, "MyReport",acViewNormal,,"[RecordID] = " & me.RecordID

Note:
"me.RecordID" is the control on your form that contains the unique identifier of the record currently being displayed. If it is a text value instead of a number, change the criteria to read:

DoCmd.OpenReport, "MyReport",acViewNormal,,"[RecordID] = '" & me.RecordID & "'"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top