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

How do I print a report from the open record in a form?

Status
Not open for further replies.

Rode

Technical User
May 2, 2000
1
US
I want to open a record in a form and pick a print button to only print the record in front of me, not the whole query of records. Seems simple but it escapes me.<br><br>Thanks,<br><br>Rod
 
have the report either:<br>1. running off a query that has the same record source as the form, with criteria in the primary key field that says[Forms]![YourFormName]![PrimaryKeyName]<br>so that is limits to just the displayed record.<br><br>or <br><br>2. use the code<br><b>Private Sub<br>&nbsp;&nbsp;&nbsp;&nbsp;Dim stDocName As String<br>&nbsp;&nbsp;&nbsp;&nbsp;Dim stLinkCriteria As String<br><br>&nbsp;&nbsp;&nbsp;&nbsp;stDocName = &quot;Your Report Name&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;stLinkCriteria = &quot;[PrimaryKey]=&quot; & Me![PrimaryKey]<br>&nbsp;&nbsp;&nbsp;&nbsp;DoCmd.OpenReport stDocName, acViewNormal, stLinkCriteria<br>End Sub<br></b><br> <p>Brian Famous<br><a href=mailto:bfamous@ncdoi.net>bfamous@ncdoi.net</a><br><a href= > </a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top