Querying with NOT as a string

Mocha Float

New member
Local time
Today, 14:00
Joined
Feb 15, 2013
Messages
9
Hello,

Firstly, I'd like to point out that I'm using Access 2010 Web.

So I have a table of "rules" that determines if an input in a form is valid or not. For example, if I choose A for one combo box, another combo box might be filtered to only show x, y and z based on my table. However, for some rules, I list, for example, "NOT x" as opposed to having a huge amount of records containing every possibility of values that aren't x. Of course when querying, it reads "NOT x" as a string instead of seeing NOT as a keyword.

So my question is:

Is there a way around this where I could keep the simplicity of using negations in a table (maybe another method of simplicity?), or would I have to list all the possibilities in my table of rules?
 
Not used 2010 web so am just guessing. Would: Not Like "x" work to validate the text ?
 
It is not possible to change the structure of a querydef with an argument. You would need to replace the RecordSource with a new SQL string if that is what you need to do.
Select .. From .. Where .. = [enter value];
Select .. From .. Where .. NOT = [enter value]:

Changing "=" to "Not =" is a structural change since it could change the query's execution plan (what Access has determined it needs to do to find the requested data). When you use a querydef, it is saved and "compiled" so you are not changing the source when you provide a parameter.
 

Users who are viewing this thread

Back
Top Bottom