Hello Experts,
I have a form that uses two cascading combo boxes (cboCity and CboStreet) to filter records in a subform.
The code I use for that is:
So far it works fine. Now I have a need to add 2 more combo boxes (cboCivilYear and cboLocalYear) that should filter the records further. For the life of me I can't figure it out.
I have a form that uses two cascading combo boxes (cboCity and CboStreet) to filter records in a subform.
The code I use for that is:
Code:
Private Sub cboCity_AfterUpdate()
sfrmDonorInput.Form.Filter = "[City]= '" & cboCity & "'"
sfrmDonorInput.Form.FilterOn = True
Me.cboStreet = Null
Me.cboStreet.Requery
End Sub
Private Sub cboStreet_AfterUpdate()
If IsNull(cboStreet) = False Then
sfrmDonorInput.Form.Filter = "[City]= '" & cboCity & "'"
sfrmDonorInput.Form.Filter = "[Street]= '" & cboStreet & "'"
sfrmDonorInput.Form.FilterOn = True
End If
End Sub
So far it works fine. Now I have a need to add 2 more combo boxes (cboCivilYear and cboLocalYear) that should filter the records further. For the life of me I can't figure it out.