Not Like *[field]*

Purdue2479

Registered User.
Local time
Today, 08:32
Joined
Jul 1, 2003
Messages
52
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
 

Attachments

If this...
SIDE_DRUG_DESC Text: ANTIHISTAMINE
is a text box on a form, use this...
Code:
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 GENERATION
Search field?? Where?? Are you entering a search string somewhere (Like "ANTIHISTAMINE")??
 

Attachments

Last edited:
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.
 

Users who are viewing this thread

Back
Top Bottom