Printing a report from a form (current record) in MS Access - TechRepublic
Question
April 23, 2009 at 02:27 AM
james

Printing a report from a form (current record) in MS Access

by james . Updated 17 years, 1 month ago

I have a form in MS Access that I want to fill out like an invoice and then print just that particular order using a report but I can’t seem to get it to work.

Can someone help please?

Here is the code I am using from a command button to open the report but it shows errors for the fields:

Sub PrintInvoice_Click()

Dim strDocName As String
Dim strWhere As String
strDocName = “Orders”
strWhere = “[OrderID]=” & Me!OrderID
DoCmd.OpenReport strDocName, acPreview, , strWhere

End Sub

Thanks in advance.

This discussion is locked

All Comments