Printing a report from a form (current record) in MS AccessLocked
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:
Dim strDocName As String
Dim strWhere As String
strDocName = “Orders”
strWhere = “[OrderID]=” & Me!OrderID
DoCmd.OpenReport strDocName, acPreview, , strWhere
Thanks in advance.