View Full Version : Where condition problem


human_anomaly
10-20-2004, 06:14 AM
This should have a pretty simple answer. All I am trying to do is open a report and throw multiple where clauses at it. I am connecting them with "and" and it seems to like the syntax but as soon as I run the macro from the form button it chokes. I've triple checked my form names and control names. Anyone know how to do a multiple where condition? Here is my code:

[Student]=[Forms]![FrmSubStudent]![Student] And [Scenario]=[Forms]![FrmSubStudent]![Scenario] And [Date1]=[Forms]![FrmSubStudent]![Date1]

Uncle Gizmo
10-20-2004, 06:31 AM
I suggest that you simplify your where clause into the three groups without any ANDS , and check them individually if they'd all work individually then try building them together one at a time.

human_anomaly
10-20-2004, 06:42 AM
These work individually:
[Student]=[Forms]![FrmSubStudent]![Student]

[Scenario]=[Forms]![FrmSubStudent]![Scenario]

however when I combine them they do not work, like this:

[Student]=[Forms]![FrmSubStudent]![Student] AND [Scenario]=[Forms]![FrmSubStudent]![Scenario]

ColinEssex
10-20-2004, 06:49 AM
Just a guess, but are any of the fields likely to be Null?

Col

human_anomaly
10-20-2004, 06:52 AM
no, its not allowed

Uncle Gizmo
10-20-2004, 06:56 AM
if you dupilcate it in a query do you get any results?

human_anomaly
10-20-2004, 06:59 AM
no, it seems to be comming up empty

human_anomaly
10-20-2004, 08:29 AM
but the code in the criteria box is:
= N'[Forms]!FrmSubStudent!Scenario'
and i don't think that is right