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?
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
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.