Created an option group for filtering the records (all and Retention) with two buttons. But the form is not toggling between the buttons. I used the wizard to build it and selected "Save the value for later use." I tried it in Access 2003 and Access 2007 with the same problem. It works in an Access '97 version of a db I converted to 2003. But if I try to create it from scratch in 2003 or 2007, it doesn't work.
Added the following:
Private Sub FilterByGroup_AfterUpdate()
If FilterByGroup = 2 Then
Me.Filter = "group = 'Retention'"
Me.FilterOn = True
Else
Me.FilterOn = False
End If
End Sub
Private Sub Form_ApplyFilter(Cancel As Integer, ApplyType As Integer)
If ApplyType = acShowAllRecords Then
FitlerByGroup = 1 ' Set the All Contacts option value.
ElseIf Filter <> "group = 'Retention'" Then
FitlerByGroup = Null ' Don't set any option value.
End If
End Sub
Thanks!
Added the following:
Private Sub FilterByGroup_AfterUpdate()
If FilterByGroup = 2 Then
Me.Filter = "group = 'Retention'"
Me.FilterOn = True
Else
Me.FilterOn = False
End If
End Sub
Private Sub Form_ApplyFilter(Cancel As Integer, ApplyType As Integer)
If ApplyType = acShowAllRecords Then
FitlerByGroup = 1 ' Set the All Contacts option value.
ElseIf Filter <> "group = 'Retention'" Then
FitlerByGroup = Null ' Don't set any option value.
End If
End Sub
Thanks!