View Full Version : Not Like *[field]*


Purdue2479
09-28-2007, 11:31 AM
I am trying to exclude records that have a value like another value in a seperate field, but Access is not excluding the records. Any suggestions on what I could do differently would be appreciated.

I have attached a snapshot of the query.

Here is the expression I am trying to use:

Not Like "*" & [qry1000_003_02-Base].[SIDE_DRUG_DESC] & "*"

SIDE_DRUG_DESC Text: ANTIHISTAMINE

Search Field:
ANTIHISTAMINES - 1ST GENERATION

ajetrumpet
09-29-2007, 06:47 AM
If this...SIDE_DRUG_DESC Text: ANTIHISTAMINEis a text box on a form, use this...Not Like "*" & Forms!FormName!txtboxname & "*"Not Like "*" & [qry1000_003_02-Base].[SIDE_DRUG_DESC] & "*"I don't know if that can even be evaluated. Sounds like it is just being ignored. Type the field VALUE, not the field NAME.Search Field: ANTIHISTAMINES - 1ST GENERATIONSearch field?? Where?? Are you entering a search string somewhere (Like "ANTIHISTAMINE")??

Purdue2479
09-30-2007, 02:02 PM
Thanks for the response. I ended up figuring it out. I needed to trim the search field. It was comparing the field values using the extra spaces.