I have a subform that shows all the records in my table. I also have an option group representing the 4 quarters of a year. I am trying to filter the data in the subform based on the current selected option.
What is the best way to do this? Here is what I have so far I just need the proper code for setting the "filter" on the subform instead of the OpenForm that is currently in my code.
What is the best way to do this? Here is what I have so far I just need the proper code for setting the "filter" on the subform instead of the OpenForm that is currently in my code.
Code:
Dim strNumb As String
If Me.frmChoose = 1 Then
strNumb = "1st"
ElseIf Me.frmChoose = 2 Then
strNumb = "2nd"
ElseIf Me.frmChoose = 3 Then
strNumb = "3rd"
ElseIf Me.frmChoose = 4 Then
strNumb = "4th"
End If
' I need to filter the frmSafeIncentSub subform
' with the selected criteria instead of opening
' the form.
DoCmd.openform "frmSafeIncentSub", acNormal, , _
"[quarter]='" & strNumb & "'"