Re: Not sure I can do this.
- From: John Vinson <jvinson@xxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 23 Aug 2005 22:47:58 -0600
On Tue, 23 Aug 2005 13:16:04 -0700, "Karen53"
<Karen53@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
>WHERE (((qry_postmortems_Date.Issue_Platform) Like "*" &
>[Forms]![frmPOP_NeilsTrendReports]![txt_NeilsTrendRpt] & "*")) OR
>(((qry_postmortems_Date.Issue_Platform) Like "*" &
>[Forms]![frmPOP_NeilsTrendReports]![txt_NeilsTrendRpt] & "*") AND
>((qry_postmortems_Date.Balboa)=NZ([Forms]![frmPOP_NeilsTrendReports]![chk_Balboa],0))
>AND
The problem is that OR.
If either of the first two criteria are true, the record will be
retrieved REGARDLESS of the values in the checkboxes.
Put an extra left parenthesis after WHERE, and an extra right
parenthesis before the first AND.
And...
****** NORMALIZE YOUR TABLES ********
If you think *this* query is difficult, they'll get a LOT worse (if
you want to do, say, a date range). And the difficulty is all
*unnecessary* - the syntax
WHERE ((((qry_postmortems_Date.Issue_Platform) Like "*" &
[Forms]![frmPOP_NeilsTrendReports]![txt_NeilsTrendRpt] & "*")) OR
(((qry_postmortems_Date.Issue_Platform) Like "*" &
[Forms]![frmPOP_NeilsTrendReports]![txt_NeilsTrendRpt] & "*"))
AND (
(Forms!frmPOP_NeilsTrendReports![chk_Balboa] AND BusinessUnit =
"Balboa")
OR
(Forms!frmPOP_NeilsTrendReports![chk_CIS] AND BusinessUnit = "CIS")
OR
( <etc etc> )
will let you store the data correctly - without multiple yes/no fields
and without storing data in fieldnames - and still allow the user to
query by selecting checkboxes.
John W. Vinson[MVP]
.
- Follow-Ups:
- Re: Not sure I can do this.
- From: Karen53
- Re: Not sure I can do this.
- References:
- RE: Not sure I can do this.
- From: Ofer
- RE: Not sure I can do this.
- From: Karen53
- RE: Not sure I can do this.
- From: Karen53
- RE: Not sure I can do this.
- From: Ofer
- RE: Not sure I can do this.
- From: Karen53
- Re: Not sure I can do this.
- From: John Vinson
- Re: Not sure I can do this.
- From: Karen53
- Re: Not sure I can do this.
- From: John Vinson
- Re: Not sure I can do this.
- From: Karen53
- RE: Not sure I can do this.
- Prev by Date: Re: Verify data with Dlookup
- Next by Date: Re: Type Mismatch Error
- Previous by thread: Re: Not sure I can do this.
- Next by thread: Re: Not sure I can do this.
- Index(es):
Relevant Pages
|