Like parameter

geno

Registered User.
Local time
Today, 16:52
Joined
Jun 19, 2000
Messages
243
Hi,

I'm using Access 2003

I have a query that searches a parts table by description:

Like "*" & [Enter in Part Description to search] & "*"

I need to add another search to this query, I added another field to the parts table call manufacturer. I add this field to the above query and added this parameter to it:

Like [Enter in Manufacturer] & "*"

I then added a manufacturer to one of the fields for test purposes.

For some odd reason this doesn't work. If I take out the manufacturer parameter and don't enter in anything into the part description the query returns all the records. When i type a description into the part description field the query returns the proper records. When I add back the manufacturer parameter and enter through both parameters only the one record returns showing the test record instead of all of them. If I put a part description in and enter through the manufacturer parameter no records show when they should.

I've tried adding a test field to a different table and tried a different query using the like parameter. The parameter works in a field already in the table but won't work with the new field I added. I've done compact and repair.

Is there something wrong with Access that I don't know about.

Thanks for any input.
 
Like "*" doesn't return nulls

Brian
 
Thanks Brian.

I guess I'll have to update this field with something until the customer can enter in his data.
 
You could add or is null then null fields would always be selected leaving the control with the other parameter in the case of nulls
This may get split into two rows in the criteria in which case you will need two rows for the other criteria, not sure if that will cause it to be asked for twice as I always use a form rather than pop ups


Brian
 
Hi,

What I did was run an update query on this field and set it to ""
Don't know why but now the query works.

Thanks again Brian
 
What I did was run an update query on this field and set it to ""
Don't know why but now the query works.
"" is an Empty (or Zero Length) String

"" is not the same as NULL
 

Users who are viewing this thread

Back
Top Bottom