Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Option Group Not Toggling

Status
Not open for further replies.

jnameika

MIS
Mar 20, 2009
12
0
0
US
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!
 
I think I found it. It seems to have to do with me.allowedits logic. When I click on the edit record button, I can toggle between them, but have to click on edit record button each time and the filter works. So I guess I have to have me.allowedits = true even when filtering?
 
If you have AllowEdits set to No, you cannot edit the record, which is what you're attempting to do by trying to click on a button in the Option Group.

You don't have to have Me.AllowEdits = True to filter, but you do when you make a selection from the Option Group.

The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top