Show all the values that DON'T match

tpickles1984

Registered User.
Local time
Today, 05:50
Joined
Feb 5, 2003
Messages
19
I have a query that reads a value from a form, and then displays all of the records from a table that match this value. The code goes something like this:

[Forms]![FrmForm]![Text Box]

This is all well and good, but is the inverse to what I want. I'd like a query that displays all the records that DON'T match this value. I've tried using the <> notation for not, but this does not seem to work. I've knocked up a quick example database of what I'm trying to do, it should be attached to this thread.

Test.zip

First, go in to the form and type a 1 into the first text box, and then click on to the next text box to fix the value in there. Keep this form open.

Next, run the query. Three records should be returned; Jon, Tom and Harry. Notice that all these records have a 1 in their number box. Close this query if you like.

Next, open up the table and have a look. There are six records in all. Jon, Tom and Harry have the number 1, and Jane, Jake and Sheila have 2, 2 and 3 respectively.

So how do I change the query to search for the number from the form, but return the records Jane, Jake and Sheila instead? Thanks!
 

Attachments

Using <>([Forms]![FrmForm]![Text Box]) works for me.
 
Solved!

I wasn't using brackets before, I knew it would be something simple like that! Thanks a lot, I've been baffled by this for hours!
 

Users who are viewing this thread

Back
Top Bottom