Print button coding problem

Sonny Jim

Registered User.
Local time
Today, 02:09
Joined
Jan 24, 2007
Messages
98
How can I get the code below for my print button on my form to only print a report's current record (the one displayed on the form)?

Here is the code for the print button:

Private Sub cmdPrintAgencyAwkReport_Click()
On Error GoTo Err_cmdPrintAgencyAwkReport_Click

Dim stDocName As String

stDocName = "Agency Acknowledgement"
DoCmd.OpenReport stDocName, acNormal

Exit_cmdPrintAgencyAwkReport_Click:
Exit Sub

Err_cmdPrintAgencyAwkReport_Click:
MsgBox Err.Description
Resume Exit_cmdPrintAgencyAwkReport_Click

End Sub
 
Have a look at my sample posted Here, it will show you how to code a button to print or preview the current record.

If you have any further questions post back.
 
Thank you very much, that was extremely helpful.
 
Glad you liked it, hope you got it working for your db.
 

Users who are viewing this thread

Back
Top Bottom