Re: Not sure I can do this.

Tech-Archive recommends: Fix windows errors by optimizing your registry



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]


.



Relevant Pages

  • Re: Not sure I can do this.
    ... When I saved the query, Access added parenthesis'. ... > retrieved REGARDLESS of the values in the checkboxes. ... > query by selecting checkboxes. ...
    (microsoft.public.access.formscoding)
  • Re: Different data shown based on user input
    ... my advice changes with the info that there are over 200 checkboxes. ... I suggest you use combo boxes. ... Dim strStub As String ...
    (microsoft.public.access.queries)
  • Re: Shifting textboxes on report after hidden
    ... Are all of these in the same report ... section of the report and these textboxes are located in the "Exercise ... but am not quite sure how to set up the query to resolve ... This is the code I am using for the checkboxes, ...
    (microsoft.public.access.reports)
  • Re: To check all items in a subform
    ... Try a Refresh just before you run the query. ... I just tested a macro that runs an update query, ... AND on the subform too... ... Assuming the subform checkboxes are True/False Boolean... ...
    (microsoft.public.access.forms)
  • Re: To check all items in a subform
    ... Microsoft Access MVP ... Try a Refresh just before you run the query. ... AND on the subform too... ... Assuming the subform checkboxes are True/False Boolean... ...
    (microsoft.public.access.forms)