R
ryguy7272
In the QBE Grid, with Like "INT'L" in Criteria, my Query works fine. It
fails when I try to create a dynamic Query with this VBA:
' Build criteria string for Broker
For Each varItem In Me.lstBroker.ItemsSelected
strBroker = strBroker & ",'" & Me.lstBroker.ItemData(varItem) & "'"
Next varItem
If Len(strBroker) = 0 Then
strBroker = "Like " * ""
Else
strBroker = Right(strBroker, Len(strBroker) - 1)
strBroker = "IN(" & strBroker & ")"
End If
I’m sure it has to do with the ‘ in the INT’L. I tried quotes and
double-quotes, like this:
strBroker = "Like " * ""
Can’t seem to quite get it working though.
Can anyone see what the problem is?
Regards,
Ryan---
fails when I try to create a dynamic Query with this VBA:
' Build criteria string for Broker
For Each varItem In Me.lstBroker.ItemsSelected
strBroker = strBroker & ",'" & Me.lstBroker.ItemData(varItem) & "'"
Next varItem
If Len(strBroker) = 0 Then
strBroker = "Like " * ""
Else
strBroker = Right(strBroker, Len(strBroker) - 1)
strBroker = "IN(" & strBroker & ")"
End If
I’m sure it has to do with the ‘ in the INT’L. I tried quotes and
double-quotes, like this:
strBroker = "Like " * ""
Can’t seem to quite get it working though.
Can anyone see what the problem is?
Regards,
Ryan---