Multiple Where Conditions

G

Guest

I can usually get a report to open with 1 where condition, with a bit of
fiddling. Is there a way that I can use multiple conditions to open a report?

Example. I want to open rptStudentAll with a boolean true associated with a
field called StudentWatch and the field Ethnicity with a code of 3.

How do I do that?
 
J

John Spencer

It is still one where condition, you just need to build it correctly.

StrWhere = "StudentWatch=True AND Ethnicity=3"

If you are trying to build that with controls, it would be something like

StrWhere = "StudentWatch = " & me.Checkbox & " AND " & "Ethnicity = " &
me.ComboboxEthnicity

As you can see from the above you need to include the " AND " or " OR " in
quote marks as you are building the where clause.
 
G

Guest

Thanks John. I never really encountered this before.
--

Rip


John Spencer said:
It is still one where condition, you just need to build it correctly.

StrWhere = "StudentWatch=True AND Ethnicity=3"

If you are trying to build that with controls, it would be something like

StrWhere = "StudentWatch = " & me.Checkbox & " AND " & "Ethnicity = " &
me.ComboboxEthnicity

As you can see from the above you need to include the " AND " or " OR " in
quote marks as you are building the where clause.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top