Apply two filters

P

PJFry

I have a form where I want to apply two filters. The code for applying the
filters is below:

Private Sub cboClient_AfterUpdate()
Me.Filter = "txtClient= '" & Me.cboClient.Column(1) & "'"
Me.FilterOn = True
End Sub

Private Sub cboStatus_AfterUpdate()
Me.Filter = "txtScreenStatus= '" & Me.cboStatus.Column(1) & "'"
Me.FilterOn = True
End Sub

The first and second filters work fine independently, but if I apply both,
only the most recently applied is in effect. How do I get both to work at
the same time?

Please let me know if you need clarification.

Thanks!
PJ
 
K

Klatuu

You will have to apply them both together like this:

Me.Filter = "txtClient= '" & Me.cboClient.Column(1) & "' AND
txtScreenStatus= '" & Me.cboStatus.Column(1) & "'"
 

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