I have a form named frmPayments that includes a subform called frmPaymentsSubForm. The subform is populated by a query called qryPayments. The form has 3 Option Groups with radio buttons as follows: 1)optTypePmt has fields (with radio buttons) called Cash and Cred, 2) optPmtStatus has fields called Pd and Unpd, and 3) optInvSent has fields Y and N. All fields are Y/N fields in the table and query. I've created an On Click event procedure for each of the option groups with the code below, and clicking the radio button in each option group filters that set of data fine, but when I click a radio button in another option group, I lose the filtering on the first group. I'd like to be able to set the form so I can filter based on the criteria from each of the option groups, or have the flexibility to leave one or more unfiltered. I've found a couple of places online that has referenced this, but I haven't been able to figure this out and apply it to my form. Below is the coding I have for the option groups.
First Option Group
Private Sub optTypePmt
Dim strFilter As String
Select Case Me.[optTypePmt}
Case 1
Forms!frmPayments!frmPaymentsSubForm.Form.FilterOn = False
Case 2
strFilter = "[Cash] = -1"
Forms!frmPayments!frmPaymentsSubForm.Form.Filter = strFilter
Forms!frmPayments!frmPaymentsSubForm.Form.FilterOn = True
Case 3
strFilter = "[Cred] = -1"
Forms!frmPayments!frmPaymentsSubForm.Form.Filter = strFilter
Forms!frmPayments!frmPaymentsSubForm.Form.FilterOn = True
End Select
End Sub
Second Option Group
Private Sub optPmtStatus
Dim strFilter As String
Select Case Me.[optPmtStatus}
Case 1
Forms!frmPayments!frmPaymentsSubForm.Form.FilterOn = False
Case 2
strFilter = "[Pd] = -1"
Forms!frmPayments!frmPaymentsSubForm.Form.Filter = strFilter
Forms!frmPayments!frmPaymentsSubForm.Form.FilterOn = True
Case 3
strFilter = "[Unpd] = -1"
Forms!frmPayments!frmPaymentsSubForm.Form.Filter = strFilter
Forms!frmPayments!frmPaymentsSubForm.Form.FilterOn = True
End Select
End Sub
Third Option Group
Private Sub optInvSent
Dim strFilter As String
Select Case Me.[optInvSent}
Case 1
Forms!frmPayments!frmPaymentsSubForm.Form.FilterOn = False
Case 2
strFilter = "[Y] = -1"
Forms!frmPayments!frmPaymentsSubForm.Form.Filter = strFilter
Forms!frmPayments!frmPaymentsSubForm.Form.FilterOn = True
Case 3
strFilter = "[N] = -1"
Forms!frmPayments!frmPaymentsSubForm.Form.Filter = strFilter
Forms!frmPayments!frmPaymentsSubForm.Form.FilterOn = True
End Select
End Sub