I've set up a query by form of my database. One of the fields is "Origin City" so that the user can search by the origin point of a shipment.
In the query, the string is as follows:
This string allows the user to enter in as much data as they want into the search field, or to leave the field null and search on other fields in the form instead.Code:Like "*" & [Forms]![Trucking Lane Search]![Origin City] & "*" And Like "*" & [Forms]![Trucking Lane Search]![Origin City] & "*"
When I use a text box for this field, it works just fine. I type "Cityville," and it returns all results originating from Cityville. I can even type in "City" and it will return all results originating from Cityville.
However, when I use a combo-box to generate the search field results (so that the user doesn't have to guess that I have saved it as Cityville rather than Townsport, the suburb of Cityville), the query returns blank.
The combo-box "Origin City" is referenced to the table "Origin", in which "Origin City" is a field. The query is also referencing the same "Origin City" field in the "Origin" table. It is an exact match of the referenced table, so there shouldn't be any confusion on the computer's part.
Even when I manually type in the exact match to a text box, the desired results are returned. However, an exact match from a combo box doesn't seem to work. I don't see how the computer is delineating between a manually-typed exact match and a combo-box-returned exact match. Any thoughts?