Option Group And Combo Box filter (1 Viewer)

Nightfire22255

New member
Local time
Today, 04:29
Joined
Dec 21, 2020
Messages
6
Hello all,

I need some guidance on filtering a subform with an option group and a combo box

Basically, I want to use an Option Group of months. When I choose what month, it will filter my subform to those month's and the combo box is used to filter the year.

Thanks for the help.

From the screenshot, I'm filtering just from one date in the record.

Example.png
 

theDBguy

I’m here to help
Staff member
Local time
Today, 07:29
Joined
Oct 29, 2018
Messages
21,358
Hi. Welcome to AWF!

Should be just a matter of building a Filter string. For example:
Code:
strFilter = "Month(DateFieldName)=" & Me.OptionGroupName
Me.Filter = strFilter
Me.FilterOn = True
Hope that helps...
 
Last edited:

Nightfire22255

New member
Local time
Today, 04:29
Joined
Dec 21, 2020
Messages
6
Thanks for replying!

I figured how to do the option group. I just don't how to use the combo box(which chooses the year to filter) in conjunction with the option group.

Any tips on that. Thank you though.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 07:29
Joined
Oct 29, 2018
Messages
21,358
Thanks for replying!

I figured how to do the option group. I just don't how to use the combo box(which chooses the year to filter) in conjunction with the option group.

Any tips on that. Thank you though.
Okay, you could try it this way.
Code:
strFilter = "DateFieldName Between DateSerial(" & Me.ComboName & "," & Me.OptionGroupName & ",1) _
    & " And DateSerial(" & Me.ComboName & "," & Me.OptionGropuName + 1 & ",0)"
Hope that helps...
 

Users who are viewing this thread

Top Bottom