View Full Version : Multiple Filters on one subform


dgaller
11-05-2007, 09:08 AM
I currently have code on click to filter a subform based on a combo box and it works great. (see below)

Me.[task detail subform].Form.Filter = "[Person Responsible] =" & Me!Combo107
Me.[task detail subform].Form.FilterOn = True

The problem is I also need to only show records that have a 1, 2 or 3 in the status field on the same report.

How do I join that to the above filter?

KenHigg
11-05-2007, 09:12 AM
Just wrap the pcs in parens and joing them with 'and'.


:)
ken

dgaller
11-05-2007, 09:27 AM
I tried doing :
Me.[task detail subform].Form.Filter = "[Person Responsible] =" & Me!Combo107 And Me.[task detail subform].Form.Filter = "[status] =1" but I get a type mismatch error. Status is a field I have a look up to. (Example 1 = open)

KenHigg
11-05-2007, 09:33 AM
Me.[task detail subform].Form.Filter = "([Person Responsible] =" & Me!Combo107 & ") And ([status] =1)"

or

Me.[task detail subform].Form.Filter = "([Person Responsible] =" & Me!Combo107 & ") And ([status] ='1')"


???
ken

dgaller
11-05-2007, 09:58 AM
It worked. I truly appreciate your help, Ken!

KenHigg
11-05-2007, 10:00 AM
Glad to help :)