D
delgado92651
Hi
I'm trying to filter a group of records by first name using a group
option control, options in this example are Jim, Mike & All.
The option control is on the detail section of the main form, also in
the same section is the sub form I'm trying to filter. The subform is
in data sheet view (if that makes any difference). When I press the
toggle buttons nothing happens. I tried putting the toggle option
group in the header of the sub form but I can't get it to display
there, I think I remember reading someplace in datasheet view you
can't see the footer or header?
Have the following code in the After Update [Event Procedure] of the
filterOptionGroup control
Private Sub filterOptionGroup_AfterUpdate()
With Forms!frmMain
Select Case Me.filterOptionGroup
Case 1
..RecordSource = "SELECT * FROM frmMain WHERE FirstName Not Like 'Jim'"
Case 2
..RecordSource = "SELECT * FROM frmMain WHERE FirstName Like 'Mike'"
Case 3
..RecordSource = "frmMain"
End Select
End With
End Sub
Thanks
Al
I'm trying to filter a group of records by first name using a group
option control, options in this example are Jim, Mike & All.
The option control is on the detail section of the main form, also in
the same section is the sub form I'm trying to filter. The subform is
in data sheet view (if that makes any difference). When I press the
toggle buttons nothing happens. I tried putting the toggle option
group in the header of the sub form but I can't get it to display
there, I think I remember reading someplace in datasheet view you
can't see the footer or header?
Have the following code in the After Update [Event Procedure] of the
filterOptionGroup control
Private Sub filterOptionGroup_AfterUpdate()
With Forms!frmMain
Select Case Me.filterOptionGroup
Case 1
..RecordSource = "SELECT * FROM frmMain WHERE FirstName Not Like 'Jim'"
Case 2
..RecordSource = "SELECT * FROM frmMain WHERE FirstName Like 'Mike'"
Case 3
..RecordSource = "frmMain"
End Select
End With
End Sub
Thanks
Al