I am trying to write a query that will search the database for a portion of a string that is input by a user.
The field I am looking at sometimes contains dashes, leading zeros, etc. so I want to use the LIKE as a contains because the user does not know exactly how it was entered.
So I want to know if the billnum contains 8836 - it may be entered as 08836, a8836, 8836-a, etc. I can find it if I enter it exactly as it is in the database with the following line:
but I can't find a way to have it look for the string in the field. Maybe it can't be done in Access or I have to use VB?
I tried:
- didn't get a syntax error, but it's not finding my record.
Any help would be greatly appreciated!
Kathy
The field I am looking at sometimes contains dashes, leading zeros, etc. so I want to use the LIKE as a contains because the user does not know exactly how it was entered.
So I want to know if the billnum contains 8836 - it may be entered as 08836, a8836, 8836-a, etc. I can find it if I enter it exactly as it is in the database with the following line:
Code:
WHERE (Claims.BillNum1)=[Forms]![FindProNumber]![BillNumber]
I tried:
Code:
WHERE (Claims.BillNum1) like ‘*[Forms]![FindProNumber]![BillNumber]*’)
Any help would be greatly appreciated!
Kathy
Comment