Using Expression to Group

K

Kay

I hope I am responding with the info you need. The combo box is unbound
however it's rowsource is a table and its rowsourcetype is field list.
 
K

Kay

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
 
K

Kay

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
 

Ask a Question

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.

Ask a Question

Top