Question Locked

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

0 helpful
1 reply
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

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.

1 reply

This discussion is closed to new replies.