Good day!
I have at present 2 combo box's that filter, now....... the 1st combo box is a drop down value list that will filter the OPOwner (persons name) for example there are 3000 records and 5 OPOwners, I can for now filter my name in cboOPOwner combo box.
The 2nd box (drop down list) is Status which would be "New";"Open";Pipeline";"Lead" ect...
If I filter my name it brings up all records related to my name and the when I want to filter status it will bring up all records relating to say 'Pipeline' however it will bring everyone's ;Pipeline and not just mine.
What I want is to filter my name in the OPOwner combo box and once all records are filtered in my name then in the status combo box filter what ever I want to look at. example what I want to filter - 'Filter Neil' then 'Filter Pipeline, or filter Lead or New'.
This is the code I have in both combo's....
Private Sub cboOPOwner_AfterUpdate()
If Nz(Me.cboOPOwner.Text) = "" Then
Me.Form.Filter = ""
Me.FilterOn = False
ElseIf Me.cboOPOwner.ListIndex <> -1 Then
Me.Form.Filter = "[OPOwner] = '" & _
Replace(Me.cboOPOwner.Text, "'", "''") & "'"
Me.FilterOn = True
Else
Me.Form.Filter = "[OPOwner] Like '*" & _
Replace(Me.cboOPOwner.Text, "'", "''") & "*'"
Me.FilterOn = True
End If
Me.cboOPOwner.SetFocus
Me.cboOPOwner.SelStart = Len(Me.cboOPOwner.Text)
End Sub
*****And then***************
Private Sub cboStatus_AfterUpdate()
If Nz(Me.cboStatus.Text) = "" Then
Me.Form.Filter = ""
Me.FilterOn = False
ElseIf Me.cboStatus.ListIndex <> -1 Then
Me.Form.Filter = "[Status] = '" & _
Replace(Me.cboStatus.Text, "'", "''") & "'"
Me.FilterOn = True
Else
Me.Form.Filter = "[Status] Like '*" & _
Replace(Me.cboStatus.Text, "'", "''") & "*'"
Me.FilterOn = True
End If
Me.cboStatus.SetFocus
Me.cboStatus.SelStart = Len(Me.cboStatus.Text)
End Sub
Please can someone help as I have looked for months on forums and YouTube!
:banghead::banghead::banghead::banghead:
I have at present 2 combo box's that filter, now....... the 1st combo box is a drop down value list that will filter the OPOwner (persons name) for example there are 3000 records and 5 OPOwners, I can for now filter my name in cboOPOwner combo box.
The 2nd box (drop down list) is Status which would be "New";"Open";Pipeline";"Lead" ect...
If I filter my name it brings up all records related to my name and the when I want to filter status it will bring up all records relating to say 'Pipeline' however it will bring everyone's ;Pipeline and not just mine.
What I want is to filter my name in the OPOwner combo box and once all records are filtered in my name then in the status combo box filter what ever I want to look at. example what I want to filter - 'Filter Neil' then 'Filter Pipeline, or filter Lead or New'.
This is the code I have in both combo's....
Private Sub cboOPOwner_AfterUpdate()
If Nz(Me.cboOPOwner.Text) = "" Then
Me.Form.Filter = ""
Me.FilterOn = False
ElseIf Me.cboOPOwner.ListIndex <> -1 Then
Me.Form.Filter = "[OPOwner] = '" & _
Replace(Me.cboOPOwner.Text, "'", "''") & "'"
Me.FilterOn = True
Else
Me.Form.Filter = "[OPOwner] Like '*" & _
Replace(Me.cboOPOwner.Text, "'", "''") & "*'"
Me.FilterOn = True
End If
Me.cboOPOwner.SetFocus
Me.cboOPOwner.SelStart = Len(Me.cboOPOwner.Text)
End Sub
*****And then***************
Private Sub cboStatus_AfterUpdate()
If Nz(Me.cboStatus.Text) = "" Then
Me.Form.Filter = ""
Me.FilterOn = False
ElseIf Me.cboStatus.ListIndex <> -1 Then
Me.Form.Filter = "[Status] = '" & _
Replace(Me.cboStatus.Text, "'", "''") & "'"
Me.FilterOn = True
Else
Me.Form.Filter = "[Status] Like '*" & _
Replace(Me.cboStatus.Text, "'", "''") & "*'"
Me.FilterOn = True
End If
Me.cboStatus.SetFocus
Me.cboStatus.SelStart = Len(Me.cboStatus.Text)
End Sub
Please can someone help as I have looked for months on forums and YouTube!



Last edited: