Db-why-not
Registered User.
- Local time
- Yesterday, 19:36
- Joined
- Sep 17, 2019
- Messages
- 159
I'm trying to set 2 different filters at the same time but when I try to do both it doesn't work. I have 2 combo boxs, one with month, one for Year. I want to be able to select month and year and filter my year and month fields. for my continuous form. It works when I only have the code for one of the fields.
Code:
Private Sub cmdFilter_Click()
Dim ComboContentsMth As String
Dim ComboContentsYr As String
If (IsNull(Me.cboMonth) Or IsNull(Me.cboYear)) Then
MsgBox "Please select a month and year to filter"
Else
ComboContentsMth = Me.cboMonth
ComboContentsYr = Me.cboYear
Me.Filter = "[mth]= " & ComboContentsMth
Me.Filter = "[Yr]= " & ComboContentsYr
Me.FilterOn = True
End If
End Sub