Re: problem getting a query to recognize "Not" and "<>" in a value list combo box
- From: John W. Vinson <jvinson@xxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 05 Jul 2009 12:43:47 -0600
On Sun, 5 Jul 2009 00:22:56 -0700, "Paul" <begone@xxxxxxxx> wrote:
I didn't realize you could designate a form control in a query field and
then apply criteria to it. I can see where once you grasp that concept, the
other logic you suggested in the WHERE clause will produce the desired
records. But setting a query field to the value of a form control - it
would never have occurred to me to do that. When I think of queries, I
always think in terms of building it from fields in tables and other
queries, and sometimes even adding an expression that might not consist of
fields. But putting a form control in there, somehow seems
counterintuitive. I can see that it works, but I guess I need to mull it
over for a while before I can really grasp it conceptually.
I remember having just the same astonished reaction when I first learned this
trick. It's cool.
The WHERE clause is just a Boolean algebra expression which evaluates to
either TRUE or FALSE. If it's TRUE... the record is retrieved. If it's
FALSE... it's not. Of course normally the truth or falsity of the expression
depends on the value of a field or fields in the record; but, as in this case,
there are times when you make the decision on some other basis.
I've even had occasion to use queries with
WHERE 1 = 1
or
WHERE 1 = 0
if I want to explicitly retrieve all (or no) records.
--
John W. Vinson [MVP]
.
- Follow-Ups:
- References:
- problem getting a query to recognize "Not" and "<>" in a value list combo box
- From: Paul
- Re: problem getting a query to recognize "Not" and "<>" in a value list combo box
- From: John W . Vinson
- Re: problem getting a query to recognize "Not" and "<>" in a value list combo box
- From: Paul
- Re: problem getting a query to recognize "Not" and "<>" in a value list combo box
- From: John W . Vinson
- Re: problem getting a query to recognize "Not" and "<>" in a value list combo box
- From: Paul
- Re: problem getting a query to recognize "Not" and "<>" in a value list combo box
- From: John W . Vinson
- Re: problem getting a query to recognize "Not" and "<>" in a value list combo box
- From: Paul
- problem getting a query to recognize "Not" and "<>" in a value list combo box
- Prev by Date: Can't Save Record and Requery
- Next by Date: Re: problem getting a query to recognize "Not" and "<>" in a value list combo box
- Previous by thread: Re: problem getting a query to recognize "Not" and "<>" in a value list combo box
- Next by thread: Re: problem getting a query to recognize "Not" and "<>" in a value list combo box
- Index(es):
Relevant Pages
|