Question

  • Creator
    Topic
  • #2167689

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

    Locked

    by james ·

    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.

All Answers

Viewing 0 reply threads