what am I doing wrong?
My report is called Booking and my primary ID is called CustomerID. The report is meant to print an invoice specific to the customerID i.e. for the current booking.
The report displays every booking instead of the one specific top the customer. The code is attatched to a button called invoice. Please help.
Code:
Private Sub Invoice_Click()
Dim strDocName As String
Dim strWhere As String
strDocName = "Booking"
strWhere = "[CustomerID]=" & Me!CustomerID
DoCmd.OpenReport strDocName, acPreview, strWhere
End Sub
My report is called Booking and my primary ID is called CustomerID. The report is meant to print an invoice specific to the customerID i.e. for the current booking.
The report displays every booking instead of the one specific top the customer. The code is attatched to a button called invoice. Please help.
Code:
Private Sub Invoice_Click()
Dim strDocName As String
Dim strWhere As String
strDocName = "Booking"
strWhere = "[CustomerID]=" & Me!CustomerID
DoCmd.OpenReport strDocName, acPreview, strWhere
End Sub