Advertisement

07.02.2008 at 09:20AM PDT, ID: 23534150
[x]
Attachment Details

Filtering more than one field on a table & showing all records that match any of the criteria

Asked by filtrationproducts in Visual Basic Programming, Microsoft Access Database, Access Forms

Tags: Microsoft, Access, 2003

I have 1 form with a combo box and a subform displaying 4 fields. The combo box is programmed to filter data from 4 fields in the subform. Since I am trying to filter more than one field I am having a problem with access filtering the 4 fields completely out since the filter criteria isn't matching on all four fields at the same time.

Is there a way to program the filter so that it will show a record from field 1 even if all the other 3 fields don't match the same criteria for that record?

NOTE: We cannot use any type of "query" filtering because it does not function with the form/combo box selection setup. This has to be programmed in with VB on the combo box. See code below for how we are currently filtering the subfields.

Start Free Trial
1:
2:
3:
4:
5:
6:
Private Sub Combo2_AfterUpdate()
Dim strFilterName As String
    strFilterName = Me.Combo2
    Me.CPARAssignments.Form.Filter = "InvBy= ImpBy= AudtBy= CPARBy=" & "'" & strFilterName & "'"
    Me.CPARAssignments.Form.FilterOn = True
End Sub
[+][-]07.02.2008 at 09:40AM PDT, ID: 21918205

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.02.2008 at 10:00AM PDT, ID: 21918423

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.02.2008 at 10:07AM PDT, ID: 21918502

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Visual Basic Programming, Microsoft Access Database, Access Forms
Tags: Microsoft, Access, 2003
Sign Up Now!
Solution Provided By: rheitzman
Participating Experts: 1
Solution Grade: A
 
 
[+][-]07.02.2008 at 10:52AM PDT, ID: 21918898

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628