iptrader
asked on
VBA syntax question
I have a search form that returns values in a subform. I recently added a field to this search form, but there is a problem. Below is the code that applies the LIKE statement to the querydef:
If Not IsNull(Me.VendItem) Then
strWhere = strWhere & "(itemvend1.[vend-item]) Like '*" & Me.VendItem & "*' AND "
End If
If VendItem contains "#", the search will come up null. The SQL works fine, I am sure it is a syntax issue. Could someone assist me with this?
Thanks. Please let me know if you have any questions.
IPT
If Not IsNull(Me.VendItem) Then
strWhere = strWhere & "(itemvend1.[vend-item]) Like '*" & Me.VendItem & "*' AND "
End If
If VendItem contains "#", the search will come up null. The SQL works fine, I am sure it is a syntax issue. Could someone assist me with this?
Thanks. Please let me know if you have any questions.
IPT
try replacing # with % ?
John
John
ASKER
John, the field name is set in the table. I am pulling it in the dropdown box directly with SELECT DISTINCT string.
Thanks,
IPT
Thanks,
IPT
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi jack,
Unfortunately a lot of our users are on Access2K.
Any tips?
Thanks,
IPT
Unfortunately a lot of our users are on Access2K.
Any tips?
Thanks,
IPT
ASKER
Jack, also, the data is legacy data. Nothing can be done about that. Sorry.
IPT
IPT
No comment has been added to this question in more than 21 days, so it is now classified as abandoned..
I will leave the following recommendation for this question in the Cleanup topic area:
Accept/jadedata
Any objections should be posted here in the next 4 days. After that time, the question will be closed.
RoutineT
EE Cleanup Volunteer
I will leave the following recommendation for this question in the Cleanup topic area:
Accept/jadedata
Any objections should be posted here in the next 4 days. After that time, the question will be closed.
RoutineT
EE Cleanup Volunteer
ASKER