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

Print only current record to report

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I have created simple databases with Access in the past but I need to print only the current record to a report. Can someone please detail how to do this?

Thanks!
 
Dear Phr3ndly,
This is the code I use for printing an Invoice
(Report Name is: HireInvoice) for a record that is open in a Form using the PK [HireJobID] to identify the same record.

It is put in the OnClick Event of a CmdButton but replace the Names as appropriate to your DB.

Code:
Private Sub cmdPrintHireInvoice_Click()
Me.Refresh
Dim strRptName As String
Dim strWhere As String
    strRptName = "HireInvoice"
    strWhere = "[HireJobID]=" & Me!HireJobID
    DoCmd.OpenReport strRptName, acPrintAll, , strWhere

End Sub
Hope it helps
Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top