A combo box selected on a form has one value. Sorting by one value doesn't do
any good. Does your combo box contain fields? If so, consider Allen Browne's
page http://www.allenbrowne.com/ser-33.html.
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#"
I ended up running a setvalue macro to set the controlsource of an unbound
field in the report header to the value of the combo box on the form. Works
Great
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.