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

One report for one record

Status
Not open for further replies.

czarjosh

Technical User
Jul 14, 2002
79
0
0
US
I want to be able to put a button on my form that prints a report just for the record i am currently viewing. Is that possible? I set a button up through the wizard and it just brings up the report with all of the records.
 
Try this in your command button on click event using your report name and your id fields.
Dim stDocName As String
Dim strCriteria As String
stDocName = "myreport"
strCriteria = "myid = " & [myID]
DoCmd.OpenReport stDocName, acPreview, , strCriteria


Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top