Hi Everyone. In my Access Database I have a subform on a Main form. I am trying to do a lookup function on the subform. I have had to created an unbound combo box which lists the three items i can seach on (address, city or state) and a text box where I type in my search criteria (ex: 4089 Main Street) and a search toggle button which goes and searches the data and returns the hits in the form.
I have this working perfecttly as long as I type in an exact match in my text search box. I am trying to add in the asterisk parameter so that the returned results will include all results that have the search criteria in them.
for example: If i type in 4089 Main my search results would return:
4089 Main St.
4089 Main Street
4089 Main Avenue
124089 Main Street
etc....
Here is my line of code for the search string:
strSQL = "SELECT DISTINCT Locations.ID FROM Locations WHERE ID Is Not Null and (" & Me!cboSelectField & "='" & Me!txtSearchText & "'" & ""
I have tried putting the Asterisks everywhere but I am doing somethign wrong. I keep getting syntax errors... or invalid operator errors. I think i must be missing the boat here with some punctuation.
The code referenced above works fine with exact matching.
Any help would be VERY muh appreciated!
Thanks
Kathy
I have this working perfecttly as long as I type in an exact match in my text search box. I am trying to add in the asterisk parameter so that the returned results will include all results that have the search criteria in them.
for example: If i type in 4089 Main my search results would return:
4089 Main St.
4089 Main Street
4089 Main Avenue
124089 Main Street
etc....
Here is my line of code for the search string:
strSQL = "SELECT DISTINCT Locations.ID FROM Locations WHERE ID Is Not Null and (" & Me!cboSelectField & "='" & Me!txtSearchText & "'" & ""
I have tried putting the Asterisks everywhere but I am doing somethign wrong. I keep getting syntax errors... or invalid operator errors. I think i must be missing the boat here with some punctuation.
The code referenced above works fine with exact matching.
Any help would be VERY muh appreciated!
Thanks
Kathy