Doreen-

Does the query run?  What you see is the result of the query compiler
"optimizing" your predicate.  Your predicates are in the form:

WHERE ((A = B) Or (B Is Null)) And ((C = D) Or (D Is Null))

The optimizer looks at that and figures out that all "ANDed" set of "OR"
criteria must be tested for each row to decide if the row qualifies.  It
restates the criteria like this:

WHERE ((A = B) And (C = D)) Or ((A = B) And (D Is Null)) Or ((B Is Null) And
(C = D)) Or ((b Is Null) And (D Is Null))

It thinks this might be faster because the row qualifies as soon as any of
the "OR" criteria are met - it doesn't necessarily have to evaluate all the
criteria.  When you add a third pair of predicates, the criteria explodes
even further.

By the way, your LEFT JOIN won't do anything because you're applying
criteria to fields in the Saadex table.  As soon as you do that, you end up
with an effective INNER JOIN.  If you really want all rows from DataEntry
and any matching filtered rows from Saadex, you must apply the criteria to
Saadex first in another query and then use that filtered query in your LEFT
JOIN.

If this query refuses to run as "too complex," your only alternative is to
evaluate the criteria entered in ReportForm, build the predicate in code,
and apply it to an unfiltered report using the WhereCondition parameter in
your OpenReport.

John Viescas, author
"Building Microsoft Access Applications"
"Microsoft Office Access 2003 Inside Out"
"Running Microsoft Access 2000"
"SQL Queries for Mere Mortals"
http://www.viescas.com/


-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf
Of DD & RL
Sent: Tuesday, January 17, 2006 10:16 AM
To: [email protected]
Subject: RE: [ms_access] Re: Multi-option form for reports

John,
  When I modified my query to your method, multiple lines are being added to
the query grid and here's what the SQL looks like after running it:
  What's happening here?
  Doreen
   
  SELECT DataEntry.RepID, Saadex.Div, Saadex.Crew, Saadex.Project,
DataEntry.Product, Saadex.HBD, Saadex.Bots, Saadex.NISD, DataEntry.NewNISD,
DataEntry.FlashDate, DataEntry.LoginID, DataEntry.Member, DataEntry.POC,
DataEntry.AccountName, Saadex.PubDate, DataEntry.Flashed, DataEntry.RepName,
Saadex.Chan, DataEntry.Rep2ID, DataEntry.Rep2Name, Saadex.Issue,
Saadex.Nonad, Saadex.NewConn, Saadex.Comp
FROM DataEntry LEFT JOIN Saadex ON (DataEntry.Product = Saadex.Prod) AND
(DataEntry.Member = Saadex.Member)
WHERE (((DataEntry.RepID)=[Forms]![ReportForm].[RepID]) AND
((Saadex.Div)=[Forms]![ReportForm].[Div]) AND
((Saadex.Crew)=[Forms]![ReportForm].[Crew]) AND
((Saadex.Project)=[Forms]![ReportForm].[Project]) AND
((DataEntry.Product)=[Forms]![ReportForm].[Product]) AND
((Saadex.HBD)=[Forms]![ReportForm].[HBD]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate] And
[Forms]![ReportForm].[ToDate])) OR
(((Saadex.Div)=[Forms]![ReportForm].[Div]) AND
((Saadex.Crew)=[Forms]![ReportForm].[Crew]) AND
((Saadex.Project)=[Forms]![ReportForm].[Project]) AND
((DataEntry.Product)=[Forms]![ReportForm].[Product]) AND
((Saadex.HBD)=[Forms]![ReportForm].[HBD]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
 ((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate] And
[Forms]![ReportForm].[ToDate]) AND (([Forms]![ReportForm].[RepID]) Is Null))
OR (((DataEntry.RepID)=[Forms]![ReportForm].[RepID]) AND
((Saadex.Crew)=[Forms]![ReportForm].[Crew]) AND
((Saadex.Project)=[Forms]![ReportForm].[Project]) AND
((DataEntry.Product)=[Forms]![ReportForm].[Product]) AND
((Saadex.HBD)=[Forms]![ReportForm].[HBD]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate] And
[Forms]![ReportForm].[ToDate]) AND (([Forms]![ReportForm].[Div]) Is Null))
OR (((Saadex.Crew)=[Forms]![ReportForm].[Crew]) AND
((Saadex.Project)=[Forms]![ReportForm].[Project]) AND
((DataEntry.Product)=[Forms]![ReportForm].[Product]) AND
((Saadex.HBD)=[Forms]![ReportForm].[HBD]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
 ((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate] And
[Forms]![ReportForm].[ToDate]) AND (([Forms]![ReportForm].[RepID]) Is Null)
AND (([Forms]![ReportForm].[Div]) Is Null)) OR
(((DataEntry.RepID)=[Forms]![ReportForm].[RepID]) AND
((Saadex.Div)=[Forms]![ReportForm].[Div]) AND
((Saadex.Project)=[Forms]![ReportForm].[Project]) AND
((DataEntry.Product)=[Forms]![ReportForm].[Product]) AND
((Saadex.HBD)=[Forms]![ReportForm].[HBD]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate] And
[Forms]![ReportForm].[ToDate]) AND (([Forms]![ReportForm].[Crew]) Is Null))
OR (((Saadex.Div)=[Forms]![ReportForm].[Div]) AND
((Saadex.Project)=[Forms]![ReportForm].[Project]) AND
 ((DataEntry.Product)=[Forms]![ReportForm].[Product]) AND
((Saadex.HBD)=[Forms]![ReportForm].[HBD]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate] And
[Forms]![ReportForm].[ToDate]) AND (([Forms]![ReportForm].[RepID]) Is Null)
AND (([Forms]![ReportForm].[Crew]) Is Null)) OR
(((DataEntry.RepID)=[Forms]![ReportForm].[RepID]) AND
((Saadex.Project)=[Forms]![ReportForm].[Project]) AND
((DataEntry.Product)=[Forms]![ReportForm].[Product]) AND
((Saadex.HBD)=[Forms]![ReportForm].[HBD]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate] And
[Forms]![ReportForm].[ToDate]) AND (([Forms]![ReportForm].[Div]) Is Null)
AND (([Forms]![ReportForm].[Crew]) Is
 Null)) OR (((Saadex.Project)=[Forms]![ReportForm].[Project]) AND
((DataEntry.Product)=[Forms]![ReportForm].[Product]) AND
((Saadex.HBD)=[Forms]![ReportForm].[HBD]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate] And
[Forms]![ReportForm].[ToDate]) AND (([Forms]![ReportForm].[RepID]) Is Null)
AND (([Forms]![ReportForm].[Div]) Is Null) AND
(([Forms]![ReportForm].[Crew]) Is Null)) OR
(((DataEntry.RepID)=[Forms]![ReportForm].[RepID]) AND
((Saadex.Div)=[Forms]![ReportForm].[Div]) AND
((Saadex.Crew)=[Forms]![ReportForm].[Crew]) AND
((DataEntry.Product)=[Forms]![ReportForm].[Product]) AND
((Saadex.HBD)=[Forms]![ReportForm].[HBD]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between
 [Forms]![ReportForm].[FromDate] And [Forms]![ReportForm].[ToDate]) AND
(([Forms]![ReportForm].[Project]) Is Null)) OR
(((Saadex.Div)=[Forms]![ReportForm].[Div]) AND
((Saadex.Crew)=[Forms]![ReportForm].[Crew]) AND
((DataEntry.Product)=[Forms]![ReportForm].[Product]) AND
((Saadex.HBD)=[Forms]![ReportForm].[HBD]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate] And
[Forms]![ReportForm].[ToDate]) AND (([Forms]![ReportForm].[RepID]) Is Null)
AND (([Forms]![ReportForm].[Project]) Is Null)) OR
(((DataEntry.RepID)=[Forms]![ReportForm].[RepID]) AND
((Saadex.Crew)=[Forms]![ReportForm].[Crew]) AND
((DataEntry.Product)=[Forms]![ReportForm].[Product]) AND
((Saadex.HBD)=[Forms]![ReportForm].[HBD]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
 ((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate] And
[Forms]![ReportForm].[ToDate]) AND (([Forms]![ReportForm].[Div]) Is Null)
AND (([Forms]![ReportForm].[Project]) Is Null)) OR
(((Saadex.Crew)=[Forms]![ReportForm].[Crew]) AND
((DataEntry.Product)=[Forms]![ReportForm].[Product]) AND
((Saadex.HBD)=[Forms]![ReportForm].[HBD]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate] And
[Forms]![ReportForm].[ToDate]) AND (([Forms]![ReportForm].[RepID]) Is Null)
AND (([Forms]![ReportForm].[Div]) Is Null) AND
(([Forms]![ReportForm].[Project]) Is Null)) OR
(((DataEntry.RepID)=[Forms]![ReportForm].[RepID]) AND
((Saadex.Div)=[Forms]![ReportForm].[Div]) AND
((DataEntry.Product)=[Forms]![ReportForm].[Product]) AND
((Saadex.HBD)=[Forms]![ReportForm].[HBD]) AND
 ((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate] And
[Forms]![ReportForm].[ToDate]) AND (([Forms]![ReportForm].[Crew]) Is Null)
AND (([Forms]![ReportForm].[Project]) Is Null)) OR
(((Saadex.Div)=[Forms]![ReportForm].[Div]) AND
((DataEntry.Product)=[Forms]![ReportForm].[Product]) AND
((Saadex.HBD)=[Forms]![ReportForm].[HBD]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate] And
[Forms]![ReportForm].[ToDate]) AND (([Forms]![ReportForm].[RepID]) Is Null)
AND (([Forms]![ReportForm].[Crew]) Is Null) AND
(([Forms]![ReportForm].[Project]) Is Null)) OR
(((DataEntry.RepID)=[Forms]![ReportForm].[RepID]) AND
 ((DataEntry.Product)=[Forms]![ReportForm].[Product]) AND
((Saadex.HBD)=[Forms]![ReportForm].[HBD]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate] And
[Forms]![ReportForm].[ToDate]) AND (([Forms]![ReportForm].[Div]) Is Null)
AND (([Forms]![ReportForm].[Crew]) Is Null) AND
(([Forms]![ReportForm].[Project]) Is Null)) OR
(((DataEntry.Product)=[Forms]![ReportForm].[Product]) AND
((Saadex.HBD)=[Forms]![ReportForm].[HBD]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate] And
[Forms]![ReportForm].[ToDate]) AND (([Forms]![ReportForm].[RepID]) Is Null)
AND (([Forms]![ReportForm].[Div]) Is Null) AND
(([Forms]![ReportForm].[Crew]) Is Null) AND
 (([Forms]![ReportForm].[Project]) Is Null)) OR
(((DataEntry.RepID)=[Forms]![ReportForm].[RepID]) AND
((Saadex.Div)=[Forms]![ReportForm].[Div]) AND
((Saadex.Crew)=[Forms]![ReportForm].[Crew]) AND
((Saadex.Project)=[Forms]![ReportForm].[Project]) AND
((Saadex.HBD)=[Forms]![ReportForm].[HBD]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate] And
[Forms]![ReportForm].[ToDate]) AND (([Forms]![ReportForm].[Product]) Is
Null)) OR (((Saadex.Div)=[Forms]![ReportForm].[Div]) AND
((Saadex.Crew)=[Forms]![ReportForm].[Crew]) AND
((Saadex.Project)=[Forms]![ReportForm].[Project]) AND
((Saadex.HBD)=[Forms]![ReportForm].[HBD]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between
 [Forms]![ReportForm].[FromDate] And [Forms]![ReportForm].[ToDate]) AND
(([Forms]![ReportForm].[RepID]) Is Null) AND
(([Forms]![ReportForm].[Product]) Is Null)) OR
(((DataEntry.RepID)=[Forms]![ReportForm].[RepID]) AND
((Saadex.Crew)=[Forms]![ReportForm].[Crew]) AND
((Saadex.Project)=[Forms]![ReportForm].[Project]) AND
((Saadex.HBD)=[Forms]![ReportForm].[HBD]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate] And
[Forms]![ReportForm].[ToDate]) AND (([Forms]![ReportForm].[Div]) Is Null)
AND (([Forms]![ReportForm].[Product]) Is Null)) OR
(((Saadex.Crew)=[Forms]![ReportForm].[Crew]) AND
((Saadex.Project)=[Forms]![ReportForm].[Project]) AND
((Saadex.HBD)=[Forms]![ReportForm].[HBD]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
 ((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate] And
[Forms]![ReportForm].[ToDate]) AND (([Forms]![ReportForm].[RepID]) Is Null)
AND (([Forms]![ReportForm].[Div]) Is Null) AND
(([Forms]![ReportForm].[Product]) Is Null)) OR
(((DataEntry.RepID)=[Forms]![ReportForm].[RepID]) AND
((Saadex.Div)=[Forms]![ReportForm].[Div]) AND
((Saadex.Project)=[Forms]![ReportForm].[Project]) AND
((Saadex.HBD)=[Forms]![ReportForm].[HBD]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate] And
[Forms]![ReportForm].[ToDate]) AND (([Forms]![ReportForm].[Crew]) Is Null)
AND (([Forms]![ReportForm].[Product]) Is Null)) OR
(((Saadex.Div)=[Forms]![ReportForm].[Div]) AND
((Saadex.Project)=[Forms]![ReportForm].[Project]) AND
((Saadex.HBD)=[Forms]![ReportForm].[HBD]) AND
 ((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate] And
[Forms]![ReportForm].[ToDate]) AND (([Forms]![ReportForm].[RepID]) Is Null)
AND (([Forms]![ReportForm].[Crew]) Is Null) AND
(([Forms]![ReportForm].[Product]) Is Null)) OR
(((DataEntry.RepID)=[Forms]![ReportForm].[RepID]) AND
((Saadex.Project)=[Forms]![ReportForm].[Project]) AND
((Saadex.HBD)=[Forms]![ReportForm].[HBD]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate] And
[Forms]![ReportForm].[ToDate]) AND (([Forms]![ReportForm].[Div]) Is Null)
AND (([Forms]![ReportForm].[Crew]) Is Null) AND
(([Forms]![ReportForm].[Product]) Is Null)) OR
(((Saadex.Project)=[Forms]![ReportForm].[Project]) AND
 ((Saadex.HBD)=[Forms]![ReportForm].[HBD]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate] And
[Forms]![ReportForm].[ToDate]) AND (([Forms]![ReportForm].[RepID]) Is Null)
AND (([Forms]![ReportForm].[Div]) Is Null) AND
(([Forms]![ReportForm].[Crew]) Is Null) AND
(([Forms]![ReportForm].[Product]) Is Null)) OR
(((DataEntry.RepID)=[Forms]![ReportForm].[RepID]) AND
((Saadex.Div)=[Forms]![ReportForm].[Div]) AND
((Saadex.Crew)=[Forms]![ReportForm].[Crew]) AND
((Saadex.HBD)=[Forms]![ReportForm].[HBD]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate] And
[Forms]![ReportForm].[ToDate]) AND (([Forms]![ReportForm].[Project]) Is
Null) AND
 (([Forms]![ReportForm].[Product]) Is Null)) OR
(((Saadex.Div)=[Forms]![ReportForm].[Div]) AND
((Saadex.Crew)=[Forms]![ReportForm].[Crew]) AND
((Saadex.HBD)=[Forms]![ReportForm].[HBD]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate] And
[Forms]![ReportForm].[ToDate]) AND (([Forms]![ReportForm].[RepID]) Is Null)
AND (([Forms]![ReportForm].[Project]) Is Null) AND
(([Forms]![ReportForm].[Product]) Is Null)) OR
(((DataEntry.RepID)=[Forms]![ReportForm].[RepID]) AND
((Saadex.Crew)=[Forms]![ReportForm].[Crew]) AND
((Saadex.HBD)=[Forms]![ReportForm].[HBD]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate] And
[Forms]![ReportForm].[ToDate]) AND
 (([Forms]![ReportForm].[Div]) Is Null) AND
(([Forms]![ReportForm].[Project]) Is Null) AND
(([Forms]![ReportForm].[Product]) Is Null)) OR
(((Saadex.Crew)=[Forms]![ReportForm].[Crew]) AND
((Saadex.HBD)=[Forms]![ReportForm].[HBD]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate] And
[Forms]![ReportForm].[ToDate]) AND (([Forms]![ReportForm].[RepID]) Is Null)
AND (([Forms]![ReportForm].[Div]) Is Null) AND
(([Forms]![ReportForm].[Project]) Is Null) AND
(([Forms]![ReportForm].[Product]) Is Null)) OR
(((DataEntry.RepID)=[Forms]![ReportForm].[RepID]) AND
((Saadex.Div)=[Forms]![ReportForm].[Div]) AND
((Saadex.HBD)=[Forms]![ReportForm].[HBD]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate)
 Between [Forms]![ReportForm].[FromDate] And [Forms]![ReportForm].[ToDate])
AND (([Forms]![ReportForm].[Crew]) Is Null) AND
(([Forms]![ReportForm].[Project]) Is Null) AND
(([Forms]![ReportForm].[Product]) Is Null)) OR
(((Saadex.Div)=[Forms]![ReportForm].[Div]) AND
((Saadex.HBD)=[Forms]![ReportForm].[HBD]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate] And
[Forms]![ReportForm].[ToDate]) AND (([Forms]![ReportForm].[RepID]) Is Null)
AND (([Forms]![ReportForm].[Crew]) Is Null) AND
(([Forms]![ReportForm].[Project]) Is Null) AND
(([Forms]![ReportForm].[Product]) Is Null)) OR
(((DataEntry.RepID)=[Forms]![ReportForm].[RepID]) AND
((Saadex.HBD)=[Forms]![ReportForm].[HBD]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
 ((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate] And
[Forms]![ReportForm].[ToDate]) AND (([Forms]![ReportForm].[Div]) Is Null)
AND (([Forms]![ReportForm].[Crew]) Is Null) AND
(([Forms]![ReportForm].[Project]) Is Null) AND
(([Forms]![ReportForm].[Product]) Is Null)) OR
(((Saadex.HBD)=[Forms]![ReportForm].[HBD]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate] And
[Forms]![ReportForm].[ToDate]) AND (([Forms]![ReportForm].[RepID]) Is Null)
AND (([Forms]![ReportForm].[Div]) Is Null) AND
(([Forms]![ReportForm].[Crew]) Is Null) AND
(([Forms]![ReportForm].[Project]) Is Null) AND
(([Forms]![ReportForm].[Product]) Is Null)) OR
(((DataEntry.RepID)=[Forms]![ReportForm].[RepID]) AND
((Saadex.Div)=[Forms]![ReportForm].[Div]) AND
 ((Saadex.Crew)=[Forms]![ReportForm].[Crew]) AND
((Saadex.Project)=[Forms]![ReportForm].[Project]) AND
((DataEntry.Product)=[Forms]![ReportForm].[Product]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate] And
[Forms]![ReportForm].[ToDate]) AND (([Forms]![ReportForm].[HBD]) Is Null))
OR (((Saadex.Div)=[Forms]![ReportForm].[Div]) AND
((Saadex.Crew)=[Forms]![ReportForm].[Crew]) AND
((Saadex.Project)=[Forms]![ReportForm].[Project]) AND
((DataEntry.Product)=[Forms]![ReportForm].[Product]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate] And
[Forms]![ReportForm].[ToDate]) AND (([Forms]![ReportForm].[RepID]) Is Null)
AND
 (([Forms]![ReportForm].[HBD]) Is Null)) OR
(((DataEntry.RepID)=[Forms]![ReportForm].[RepID]) AND
((Saadex.Crew)=[Forms]![ReportForm].[Crew]) AND
((Saadex.Project)=[Forms]![ReportForm].[Project]) AND
((DataEntry.Product)=[Forms]![ReportForm].[Product]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate] And
[Forms]![ReportForm].[ToDate]) AND (([Forms]![ReportForm].[Div]) Is Null)
AND (([Forms]![ReportForm].[HBD]) Is Null)) OR
(((Saadex.Crew)=[Forms]![ReportForm].[Crew]) AND
((Saadex.Project)=[Forms]![ReportForm].[Project]) AND
((DataEntry.Product)=[Forms]![ReportForm].[Product]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate] And
 [Forms]![ReportForm].[ToDate]) AND (([Forms]![ReportForm].[RepID]) Is Null)
AND (([Forms]![ReportForm].[Div]) Is Null) AND (([Forms]![ReportForm].[HBD])
Is Null)) OR (((DataEntry.RepID)=[Forms]![ReportForm].[RepID]) AND
((Saadex.Div)=[Forms]![ReportForm].[Div]) AND
((Saadex.Project)=[Forms]![ReportForm].[Project]) AND
((DataEntry.Product)=[Forms]![ReportForm].[Product]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate] And
[Forms]![ReportForm].[ToDate]) AND (([Forms]![ReportForm].[Crew]) Is Null)
AND (([Forms]![ReportForm].[HBD]) Is Null)) OR
(((Saadex.Div)=[Forms]![ReportForm].[Div]) AND
((Saadex.Project)=[Forms]![ReportForm].[Project]) AND
((DataEntry.Product)=[Forms]![ReportForm].[Product]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
 ((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate] And
[Forms]![ReportForm].[ToDate]) AND (([Forms]![ReportForm].[RepID]) Is Null)
AND (([Forms]![ReportForm].[Crew]) Is Null) AND
(([Forms]![ReportForm].[HBD]) Is Null)) OR
(((DataEntry.RepID)=[Forms]![ReportForm].[RepID]) AND
((Saadex.Project)=[Forms]![ReportForm].[Project]) AND
((DataEntry.Product)=[Forms]![ReportForm].[Product]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate] And
[Forms]![ReportForm].[ToDate]) AND (([Forms]![ReportForm].[Div]) Is Null)
AND (([Forms]![ReportForm].[Crew]) Is Null) AND
(([Forms]![ReportForm].[HBD]) Is Null)) OR
(((Saadex.Project)=[Forms]![ReportForm].[Project]) AND
((DataEntry.Product)=[Forms]![ReportForm].[Product]) AND
 ((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate] And
[Forms]![ReportForm].[ToDate]) AND (([Forms]![ReportForm].[RepID]) Is Null)
AND (([Forms]![ReportForm].[Div]) Is Null) AND
(([Forms]![ReportForm].[Crew]) Is Null) AND (([Forms]![ReportForm].[HBD]) Is
Null)) OR (((DataEntry.RepID)=[Forms]![ReportForm].[RepID]) AND
((Saadex.Div)=[Forms]![ReportForm].[Div]) AND
((Saadex.Crew)=[Forms]![ReportForm].[Crew]) AND
((DataEntry.Product)=[Forms]![ReportForm].[Product]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate] And
[Forms]![ReportForm].[ToDate]) AND (([Forms]![ReportForm].[Project]) Is
Null) AND (([Forms]![ReportForm].[HBD]) Is Null)) OR
 (((Saadex.Div)=[Forms]![ReportForm].[Div]) AND
((Saadex.Crew)=[Forms]![ReportForm].[Crew]) AND
((DataEntry.Product)=[Forms]![ReportForm].[Product]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate] And
[Forms]![ReportForm].[ToDate]) AND (([Forms]![ReportForm].[RepID]) Is Null)
AND (([Forms]![ReportForm].[Project]) Is Null) AND
(([Forms]![ReportForm].[HBD]) Is Null)) OR
(((DataEntry.RepID)=[Forms]![ReportForm].[RepID]) AND
((Saadex.Crew)=[Forms]![ReportForm].[Crew]) AND
((DataEntry.Product)=[Forms]![ReportForm].[Product]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate] And
[Forms]![ReportForm].[ToDate]) AND (([Forms]![ReportForm].[Div]) Is
 Null) AND (([Forms]![ReportForm].[Project]) Is Null) AND
(([Forms]![ReportForm].[HBD]) Is Null)) OR
(((Saadex.Crew)=[Forms]![ReportForm].[Crew]) AND
((DataEntry.Product)=[Forms]![ReportForm].[Product]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate] And
[Forms]![ReportForm].[ToDate]) AND (([Forms]![ReportForm].[RepID]) Is Null)
AND (([Forms]![ReportForm].[Div]) Is Null) AND
(([Forms]![ReportForm].[Project]) Is Null) AND (([Forms]![ReportForm].[HBD])
Is Null)) OR (((DataEntry.RepID)=[Forms]![ReportForm].[RepID]) AND
((Saadex.Div)=[Forms]![ReportForm].[Div]) AND
((DataEntry.Product)=[Forms]![ReportForm].[Product]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between
 [Forms]![ReportForm].[FromDate] And [Forms]![ReportForm].[ToDate]) AND
(([Forms]![ReportForm].[Crew]) Is Null) AND
(([Forms]![ReportForm].[Project]) Is Null) AND (([Forms]![ReportForm].[HBD])
Is Null)) OR (((Saadex.Div)=[Forms]![ReportForm].[Div]) AND
((DataEntry.Product)=[Forms]![ReportForm].[Product]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate] And
[Forms]![ReportForm].[ToDate]) AND (([Forms]![ReportForm].[RepID]) Is Null)
AND (([Forms]![ReportForm].[Crew]) Is Null) AND
(([Forms]![ReportForm].[Project]) Is Null) AND (([Forms]![ReportForm].[HBD])
Is Null)) OR (((DataEntry.RepID)=[Forms]![ReportForm].[RepID]) AND
((DataEntry.Product)=[Forms]![ReportForm].[Product]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
 ((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate] And
[Forms]![ReportForm].[ToDate]) AND (([Forms]![ReportForm].[Div]) Is Null)
AND (([Forms]![ReportForm].[Crew]) Is Null) AND
(([Forms]![ReportForm].[Project]) Is Null) AND (([Forms]![ReportForm].[HBD])
Is Null)) OR (((DataEntry.Product)=[Forms]![ReportForm].[Product]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate] And
[Forms]![ReportForm].[ToDate]) AND (([Forms]![ReportForm].[RepID]) Is Null)
AND (([Forms]![ReportForm].[Div]) Is Null) AND
(([Forms]![ReportForm].[Crew]) Is Null) AND
(([Forms]![ReportForm].[Project]) Is Null) AND (([Forms]![ReportForm].[HBD])
Is Null)) OR (((DataEntry.RepID)=[Forms]![ReportForm].[RepID]) AND
((Saadex.Div)=[Forms]![ReportForm].[Div]) AND
 ((Saadex.Crew)=[Forms]![ReportForm].[Crew]) AND
((Saadex.Project)=[Forms]![ReportForm].[Project]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate] And
[Forms]![ReportForm].[ToDate]) AND (([Forms]![ReportForm].[Product]) Is
Null) AND (([Forms]![ReportForm].[HBD]) Is Null)) OR
(((Saadex.Div)=[Forms]![ReportForm].[Div]) AND
((Saadex.Crew)=[Forms]![ReportForm].[Crew]) AND
((Saadex.Project)=[Forms]![ReportForm].[Project]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate] And
[Forms]![ReportForm].[ToDate]) AND (([Forms]![ReportForm].[RepID]) Is Null)
AND (([Forms]![ReportForm].[Product]) Is Null) AND
(([Forms]![ReportForm].[HBD]) Is Null)) OR
 (((DataEntry.RepID)=[Forms]![ReportForm].[RepID]) AND
((Saadex.Crew)=[Forms]![ReportForm].[Crew]) AND
((Saadex.Project)=[Forms]![ReportForm].[Project]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate] And
[Forms]![ReportForm].[ToDate]) AND (([Forms]![ReportForm].[Div]) Is Null)
AND (([Forms]![ReportForm].[Product]) Is Null) AND
(([Forms]![ReportForm].[HBD]) Is Null)) OR
(((Saadex.Crew)=[Forms]![ReportForm].[Crew]) AND
((Saadex.Project)=[Forms]![ReportForm].[Project]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate] And
[Forms]![ReportForm].[ToDate]) AND (([Forms]![ReportForm].[RepID]) Is Null)
AND (([Forms]![ReportForm].[Div]) Is Null) AND
 (([Forms]![ReportForm].[Product]) Is Null) AND
(([Forms]![ReportForm].[HBD]) Is Null)) OR
(((DataEntry.RepID)=[Forms]![ReportForm].[RepID]) AND
((Saadex.Div)=[Forms]![ReportForm].[Div]) AND
((Saadex.Project)=[Forms]![ReportForm].[Project]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate] And
[Forms]![ReportForm].[ToDate]) AND (([Forms]![ReportForm].[Crew]) Is Null)
AND (([Forms]![ReportForm].[Product]) Is Null) AND
(([Forms]![ReportForm].[HBD]) Is Null)) OR
(((Saadex.Div)=[Forms]![ReportForm].[Div]) AND
((Saadex.Project)=[Forms]![ReportForm].[Project]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate] And
[Forms]![ReportForm].[ToDate]) AND
 (([Forms]![ReportForm].[RepID]) Is Null) AND (([Forms]![ReportForm].[Crew])
Is Null) AND (([Forms]![ReportForm].[Product]) Is Null) AND
(([Forms]![ReportForm].[HBD]) Is Null)) OR
(((DataEntry.RepID)=[Forms]![ReportForm].[RepID]) AND
((Saadex.Project)=[Forms]![ReportForm].[Project]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate] And
[Forms]![ReportForm].[ToDate]) AND (([Forms]![ReportForm].[Div]) Is Null)
AND (([Forms]![ReportForm].[Crew]) Is Null) AND
(([Forms]![ReportForm].[Product]) Is Null) AND (([Forms]![ReportForm].[HBD])
Is Null)) OR (((Saadex.Project)=[Forms]![ReportForm].[Project]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate]
 And [Forms]![ReportForm].[ToDate]) AND (([Forms]![ReportForm].[RepID]) Is
Null) AND (([Forms]![ReportForm].[Div]) Is Null) AND
(([Forms]![ReportForm].[Crew]) Is Null) AND
(([Forms]![ReportForm].[Product]) Is Null) AND (([Forms]![ReportForm].[HBD])
Is Null)) OR (((DataEntry.RepID)=[Forms]![ReportForm].[RepID]) AND
((Saadex.Div)=[Forms]![ReportForm].[Div]) AND
((Saadex.Crew)=[Forms]![ReportForm].[Crew]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate] And
[Forms]![ReportForm].[ToDate]) AND (([Forms]![ReportForm].[Project]) Is
Null) AND (([Forms]![ReportForm].[Product]) Is Null) AND
(([Forms]![ReportForm].[HBD]) Is Null)) OR
(((Saadex.Div)=[Forms]![ReportForm].[Div]) AND
((Saadex.Crew)=[Forms]![ReportForm].[Crew]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
 ((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate] And
[Forms]![ReportForm].[ToDate]) AND (([Forms]![ReportForm].[RepID]) Is Null)
AND (([Forms]![ReportForm].[Project]) Is Null) AND
(([Forms]![ReportForm].[Product]) Is Null) AND (([Forms]![ReportForm].[HBD])
Is Null)) OR (((DataEntry.RepID)=[Forms]![ReportForm].[RepID]) AND
((Saadex.Crew)=[Forms]![ReportForm].[Crew]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate] And
[Forms]![ReportForm].[ToDate]) AND (([Forms]![ReportForm].[Div]) Is Null)
AND (([Forms]![ReportForm].[Project]) Is Null) AND
(([Forms]![ReportForm].[Product]) Is Null) AND (([Forms]![ReportForm].[HBD])
Is Null)) OR (((Saadex.Crew)=[Forms]![ReportForm].[Crew]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
 ((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate] And
[Forms]![ReportForm].[ToDate]) AND (([Forms]![ReportForm].[RepID]) Is Null)
AND (([Forms]![ReportForm].[Div]) Is Null) AND
(([Forms]![ReportForm].[Project]) Is Null) AND
(([Forms]![ReportForm].[Product]) Is Null) AND (([Forms]![ReportForm].[HBD])
Is Null)) OR (((DataEntry.RepID)=[Forms]![ReportForm].[RepID]) AND
((Saadex.Div)=[Forms]![ReportForm].[Div]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate] And
[Forms]![ReportForm].[ToDate]) AND (([Forms]![ReportForm].[Crew]) Is Null)
AND (([Forms]![ReportForm].[Project]) Is Null) AND
(([Forms]![ReportForm].[Product]) Is Null) AND (([Forms]![ReportForm].[HBD])
Is Null)) OR
 (((Saadex.Div)=[Forms]![ReportForm].[Div]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate] And
[Forms]![ReportForm].[ToDate]) AND (([Forms]![ReportForm].[RepID]) Is Null)
AND (([Forms]![ReportForm].[Crew]) Is Null) AND
(([Forms]![ReportForm].[Project]) Is Null) AND
(([Forms]![ReportForm].[Product]) Is Null) AND (([Forms]![ReportForm].[HBD])
Is Null)) OR (((DataEntry.RepID)=[Forms]![ReportForm].[RepID]) AND
((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate] And
[Forms]![ReportForm].[ToDate]) AND (([Forms]![ReportForm].[Div]) Is Null)
AND (([Forms]![ReportForm].[Crew]) Is Null) AND
(([Forms]![ReportForm].[Project]) Is Null) AND
 (([Forms]![ReportForm].[Product]) Is Null) AND
(([Forms]![ReportForm].[HBD]) Is Null)) OR
(((Saadex.Bots)>=[Forms]![ReportForm].[BOTS]) AND
((Saadex.NISD)>=[Forms]![ReportForm].[NISD]) AND
((DataEntry.NewNISD)>=[Forms]![ReportForm].[NewNISD]) AND
((DataEntry.FlashDate) Between [Forms]![ReportForm].[FromDate] And
[Forms]![ReportForm].[ToDate]) AND (([Forms]![ReportForm].[RepID]) Is Null)
AND (([Forms]![ReportForm].[Div]) Is Null) AND
(([Forms]![ReportForm].[Crew]) Is Null) AND
(([Forms]![ReportForm].[Project]) Is Null) AND
(([Forms]![ReportForm].[Product]) Is Null) AND (([Forms]![ReportForm].[HBD])
Is Null));

   
   
   
   
  

John Viescas <[EMAIL PROTECTED]> wrote:  IsNull is a function that tests a
single paramter and returns True if the
parameter contains the Null value.  IS NULL is a phrase in SQL.  If you
switch to SQL View in your version, you'll find:

WHERE ((DataEntry.RepID) =
IIf(IsNull([Forms]![ReportForm].[RepID]),[DataEntry].[RepID],
[Forms]![ReportForm].[RepID])

IIf performs the test in the first argument and returns the second argument
if True or the third argument if false.  If RepID on the form is null, the
resulting test is:

WHERE DataEntry.RepID = DataEntry.RepID

.. which works as long as RepID never contains a Null.

If RepID on the form is not null, the test is:

WHERE DataEntry.RepID = [Forms]![ReportForm]![RepID]

If you use my method, you'll find the SQL looks something like:

WHERE ((DataEntry.RepID) = [Forms]![ReportForm]![RepID]) Or
([Forms]![ReportForm]![RepID] IS NULL)

Only one of a set of OR predicates needs to be true to select the row, so if
the control on the form IS NULl, all rows are selected regardless of what is
in RepID.  If the control on the form does not contain a null, then RepID in
each row must match what's in the control.  I could have also said:

[Forms]![ReportForm]![RepID] Or (IsNull([Forms]![ReportForm]![RepID]))

.. but the native IS NULL test in SQL is faster than calling the function.

John Viescas, author
"Building Microsoft Access Applications"
"Microsoft Office Access 2003 Inside Out"
"Running Microsoft Access 2000"
"SQL Queries for Mere Mortals"
http://www.viescas.com/


-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf
Of rokkeee
Sent: Thursday, January 12, 2006 11:45 AM
To: [email protected]
Subject: [ms_access] Re: Multi-option form for reports

Okay, this may sound dumb, but I seem to remember the function "Is 
Null" preceding the control, and without a space in between the two 
words. My format seems to still work...was that format for earlier 
versions of Access?


--- In [email protected], "rokkeee" <[EMAIL PROTECTED]> wrote:
>
> Yes, John, I think it IS time for me to learn basic coding and I 
> will check out your website and download a database to get me 
> started [again].
> Thanks so much, John, you're great!
> Doreen
> 
> 
> --- In [email protected], "John Viescas" <[EMAIL PROTECTED]> 
wrote:
> >
> > Doreen-
> > 
> > That should work just fine for fields that cannot be Null.  If 
you 
> need to
> > filter on a field that might not have a value, you need to use 
> this on the
> > criteria line:
> > 
> > [Forms]![ReportForm].[RepID] Or ([Forms]![ReportForm].[RepID] IS 
> NULL)
> > 
> > But don't you think it's time you learned how to basic coding?  
> You can find
> > examples of custom "filter by form" on my website in the 
databases 
> in the
> > Downloads area.
> > 
> > John Viescas, author
> > "Building Microsoft Access Applications"
> > "Microsoft Office Access 2003 Inside Out"
> > "Running Microsoft Access 2000"
> > "SQL Queries for Mere Mortals"
> > http://www.viescas.com/
> > 
> > 
> > -----Original Message-----
> > From: [email protected] 
[mailto:[EMAIL PROTECTED] 
> On Behalf
> > Of rokkeee
> > Sent: Thursday, January 12, 2006 10:14 AM
> > To: [email protected]
> > Subject: [ms_access] Re: Multi-option form for reports
> > 
> > John,
> > My problem is that I don't know "code"...I actually have figured 
> out 
> > a way to do it within a query that has IIF statements as the 
> > criteria for each field, such as: 
> > IIf(IsNull([Forms]![ReportForm].[RepID]),[DataEntry].[RepID],
> [Forms]!
> > [ReportForm].[RepID])
> > So far it seems to work unless you can help me write some code.
> > 
> > Thanks for your help!
> > Doreen
> > 
> > --- In [email protected], "John Viescas" <[EMAIL PROTECTED]> 
> wrote:
> > >
> > > Doreen-
> > > 
> > > The give the user maximum flexibility, you should use reports 
> with
> > > unfiltered recordsets and dynamically build the "WHERE" clause 
> in 
> > code
> > > behind the form.  Use the filter you build in code in the 
> > WhereCondition
> > > parameter of the OpenReport method.  Examine each option and 
> > include a
> > > filter for it only if the user has picked or entered a value.
> > > 
> > > John Viescas, author
> > > "Building Microsoft Access Applications"
> > > "Microsoft Office Access 2003 Inside Out"
> > > "Running Microsoft Access 2000"
> > > "SQL Queries for Mere Mortals"
> > > http://www.viescas.com/
> > >  
> > > 
> > > -----Original Message-----
> > > From: [email protected] 
> [mailto:[EMAIL PROTECTED] 
> > On Behalf
> > > Of rokkeee
> > > Sent: Thursday, January 12, 2006 9:41 AM
> > > To: [email protected]
> > > Subject: [ms_access] Multi-option form for reports
> > > 
> > > Within my database, I know the different options we'll want to 
> use 
> > for 
> > > reporting. I've created an unbound form with several "options" 
> > fields 
> > > (combo boxes) and have each field linked to an individual 
query 
> > right 
> > > now. But, how can I set up the 'reality' that we will choose 
> more 
> > than 
> > > one option at a time?  For example, we would choose a RepID 
and 
> a 
> > > Product at the same time.
> > > 
> > > Thanks,
> > > Doreen
> > > 












  SPONSORED LINKS 
        Microsoft access database   Database development software   Database
management software     Database software   Inventory database software
Membership database software 
    
---------------------------------
  YAHOO! GROUPS LINKS 

    
    Visit your group "ms_access" on the web.
    
    To unsubscribe from this group, send an email to:
 [EMAIL PROTECTED]
    
    Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 

    
---------------------------------
  




                
---------------------------------
Yahoo! Photos
 Ring in the New Year with Photo Calendars. Add photos, events, holidays,
whatever.

[Non-text portions of this message have been removed]



 
Yahoo! Groups Links



 






 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ms_access/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to