I'm getting no error messages here, but I'm not getting any results visible when the filter is applied. There are 2 unbound combo boxes in the main form, SetStudy and SetCDB. The only possible values for the column [ROLE] are the 9 reflected in the code below. (The form and table for [ROLE] have the Row Source: "CEC Chair";"CEC Co-Chair";"CEC Member";"DSMB Chair";"DSMB Co-Chair";"DSMB Member";"CEC/DSMB Chair";"CEC/DSMB Co-Chair";"CEC/DSMB Member")
Any ideas what's going wrong with the filtering?
Code:
Private Sub SetCDB_AfterUpdate()
If Me.SetCDB.Selected(0) Then
Me.SubR.Form.Filter = "[ROLE] = " & Chr(34) & "CEC Chair" & Chr(34) & " Or [ROLE] = " & Chr(34) & "CEC Co-Chair" & Chr(34) & " Or [ROLE] = " & Chr(34) & "CEC Member" & Chr(34) & " And [STUDY NAME] = " & Chr(34) & Me.SetStudy.Value & Chr(34)
ElseIf Me.SetCDB.Selected(1) Then
Me.SubR.Form.Filter = "[ROLE] = " & Chr(34) & "DSMB Chair" & Chr(34) & " Or [ROLE] = " & Chr(34) & "DSMB Co-Chair" & Chr(34) & " Or [ROLE] = " & Chr(34) & "DSMB Member" & Chr(34) & " And [STUDY NAME] = " & Chr(34) & Me.SetStudy.Value & Chr(34)
ElseIf Me.SetCDB.Selected(2) Then
Me.SubR.Form.Filter = "[ROLE] = " & Chr(34) & "CEC/DSMB Chair" & Chr(34) & " Or [ROLE] = " & Chr(34) & "CEC/DSMB Co-Chair" & Chr(34) & " Or [ROLE] = " & Chr(34) & "CEC/DSMB Member" & Chr(34) & " And [STUDY NAME] = " & Chr(34) & Me.SetStudy.Value & Chr(34)
Else
Me.SubR.Form.Filter = "[ROLE ID] = 0"
End If
Me.SubR.Form.FilterOn = True
SubR.Requery
End Sub
Comment