I put the code on the same event i use to open the report on the form.
I think I need help, I am not very comfortable with the Select Case
Procedure. When I click the button I get an error that says "Method or Data
Member not found"
and it highlights the "Me.GroupLevel"
Should I apply the code to the report?
Private Sub Command67_Click()
Dim strWhere As String
strWhere = Me.Filter
DoCmd.OpenReport "CustomEmployeeList", acViewLayout, , strWhere
Select Case Forms!frmEmployeeMainForm!grpsort
Case 1 'Auto ID#
Me.GroupLevel(0).ControlSource = "Auto ID#"
Me.GroupLevel(1).ControlSource = "LastName"
Case 2 'Status
Me.GroupLevel(0).ControlSource = "Status"
Me.GroupLevel(1).ControlSource = "Auto ID#"
Case 3 'Department Name
Me.GroupLevel(1).ControlSource = "Auto ID#"
Me.GroupLevel(0).ControlSource = "Department Name"
Case 4 'Manager
Me.GroupLevel(1).ControlSource = "Auto ID#"
Me.GroupLevel(0).ControlSource = "Manager"
Case 5 'Pay Type
Me.GroupLevel(1).ControlSource = "Auto ID#"
Me.GroupLevel(0).ControlSource = "Pay Type"
Case 6 'Pay Frequency
Me.GroupLevel(1).ControlSource = "Auto ID#"
Me.GroupLevel(0).ControlSource = "Pay Frequency"
Case 7 'Labor Distribution
Me.GroupLevel(0).ControlSource = "Labor Distribution"
Me.GroupLevel(1).ControlSource = "Auto ID#"
End Select
End Sub