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

Printing current data in a report

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
How can I get a report to print just the one record I am looking at.

I want to put a report print button in my form to print each record one at a time.

In my form I created a report preview button but it previews all the records. I want it to just preview the current report. Is there something in my query to make it fetch just the current record I am lookin at in my form??
 
I look at the article "Print only the current record to a report" as follows:
'******************** Code Start ************************
Dim strDocName As String
Dim strWhere As String
strDocName = "rptSomeReport"
strWhere = "[RunID]=" & me!RunID
DoCmd.OpenReport strDocName, acPreview, , strWhere
'******************** Code End ************************

Where does this RunID come from? Access create this ID automatically Or should we create it and how?
George
 
Ok gc,
Here is how it gose, me!RunID, "me" meens the the curent form or "me" could be "form1!RunID".
the "!RunID" is a field on the current form RunID is something you created, it could be "me!ID" or "me!Joe"
ok real eazy....
befor the "!" is the form, after the "!" is the field
Dose this help?


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top