Select query depending on 3 different text boxes

kc1

Registered User.
Local time
Today, 05:11
Joined
Sep 22, 2008
Messages
23
Hi All Access Gurus

Got an issue with what I thought would be a simple select query.
On a form called frmMain, there are 3 text boxes that each contain a number.
The query is a group by and sum.
I want to only select the records that don't equal what is in any of the text boxes.
In the criteria I am putting the following:
<>[forms]![frmMain]![textbox1] or [forms]![frmMain]![textbox2] or [forms]![frmMain]![textbox3]
this does not work, however, if I enter the actual numbers in the criteria i.e <>"1" or "2" or "3" it works

I am stumped!

Please help

best regards

KC
 
The criteria should actually be AND:

<>[forms]![frmMain]![textbox1] AND <> [forms]![frmMain]![textbox2] AND <> [forms]![frmMain]![textbox3]

And you need the extra <> before each part.
 
Thanks

I will give it a go tomorrow.

So why did it work with OR when I actually entered the numbers?
 
Another suggestion:

NOT IN ([forms]![frmMain]![textbox1], [forms]![frmMain]![textbox2], [forms]![frmMain]![textbox3])
 
So why did it work with OR when I actually entered the numbers?
I'm thinking that it really didn't work like you thought it did, but due to whatever data you had it APPEARED to work. But it really shouldn't have either because an OR will let the other numbers come through.
 

Users who are viewing this thread

Back
Top Bottom