hockeyfan21
Registered User.
- Local time
- Today, 15:45
- Joined
- Aug 31, 2011
- Messages
- 38
Hi,
I'm having trouble with the below code - When I initially open the database and select an item in cboASR, I get this error message:
Syntax error (missing operator) in query expression 'ASR User Id] = 'thart' OR'
If I then select something in cboCust as well, it works fine, then I can go back and select an item in cboASR.
What can I do to avoid the error on the initial selection?
If Not IsNull(Me.cboASR) Then
stLinkCriteria = "[ASR User Id]= '" & Me.cboASR & "' OR"
End If
If Not IsNull(Me.cboCust) Then
stLinkCriteria = stLinkCriteria & "[Sold To Name]='" & Me.cboCust & "' "
End If
DoCmd.OpenForm stDocName, , , stLinkCriteria
Thanks in advance for any help with this!
Toni
I'm having trouble with the below code - When I initially open the database and select an item in cboASR, I get this error message:
Syntax error (missing operator) in query expression 'ASR User Id] = 'thart' OR'
If I then select something in cboCust as well, it works fine, then I can go back and select an item in cboASR.
What can I do to avoid the error on the initial selection?
If Not IsNull(Me.cboASR) Then
stLinkCriteria = "[ASR User Id]= '" & Me.cboASR & "' OR"
End If
If Not IsNull(Me.cboCust) Then
stLinkCriteria = stLinkCriteria & "[Sold To Name]='" & Me.cboCust & "' "
End If
DoCmd.OpenForm stDocName, , , stLinkCriteria
Thanks in advance for any help with this!
Toni