DoCmd (1 Viewer)

mike60smart

Registered User.
Local time
Today, 03:59
Joined
Aug 6, 2017
Messages
1,904
Hi Everyone

I get the following error when I try to use the following On Click Event:-

Code:
21      Dim strTaxExempt As String
25      If Me.TaxExempt = "No" Then
30     DoCmd.OpenReport "rptInvoiceNo", acViewPreview, , "[CustomerPurchaseOrderID]=" & Me.CustomerPurchaseOrderID And [TaxExempt] = Me.TaxExempt

35      End If

Error message is as follows:-

Any help appreciated
 

Attachments

  • error.PNG
    error.PNG
    2.7 KB · Views: 54

June7

AWF VIP
Local time
Yesterday, 18:59
Joined
Mar 9, 2014
Messages
5,466
Fix concatenation. Literal text must be within quote marks and variables outside quote marks.

DoCmd.OpenReport "rptInvoiceNo", acViewPreview, , "[CustomerPurchaseOrderID]=" & Me.CustomerPurchaseOrderID & " And [TaxExempt] = " & Me.TaxExempt
 

mike60smart

Registered User.
Local time
Today, 03:59
Joined
Aug 6, 2017
Messages
1,904
Hi June7

Many thanks now works
 

Users who are viewing this thread

Top Bottom