On My query I have a field with multiple Names. Some are Managers and some are Auditors.
- On my form, I added a field with two Items , Managers and Auditors. So, when I select Managers I would like to filter my subform and query with 5 names in my record and if I select Managers, I would like to be able filter my form/query with 3 names in my record.
below is my vba code, but it's not working,
Code:
Private Sub cboAuditor_AfterUpdate()
strManagers = "<>'Steven' And <>'Lisa' And <>'Christopher' And <>'Ronda' "
strAuditors = "'Steven' Or 'Lisa' Or 'Christopher' Or 'Ronda' Or 'Amber'"
If Me.cboAuditor = "Managers" Then
strAnalystFilter = "[Created By] = '" & strManagers & "'"
ElseIf Me.cboAuditor = "Auditors" Then
strAnalystFilter = "[Created By] = '" & strAuditors & "'"
End If
End Sub