I have a form with tabs and subforms and such to be used to lookup and add/edit employee data as needed. I want the users to be able to sort the records by any of the visible fields. Like LastName or EmpID or whatever.
I have no clue how to program this. I've found the following code in another post on this site but I don't really understand it so don't know what to change to make it work for me. I'm a novice when it comes to VBA. Any help is GREATLY appreciated.
Code:
Private Sub Report_Open(Cancel As Integer)
Select Case Forms!frmReports.fraGrouping
Case 1 'sort/group on car type
Me.GroupLevel(0).ControlSource = "CarType"
Me.txtGroup.ControlSource = "CarDesc"
Case 2 'sort/group on company
Me.GroupLevel(0).ControlSource = "Company"
Me.txtGroup.ControlSource = "Company"
Case 3 'sort on date/time, no grouping
Me.GroupLevel(0).ControlSource = "DispDateTime"
Me.txtGroup.ControlSource = "DispDateTime"
Me.GroupHeader0.Visible = False
End Select
End Sub
thanks
sparlaman