Sort Order using Code on a report

N

NEWER USER

I am trying to sort a report on a single field based on a Case selection. So
far I have...
Private Sub Report_Open(Cancel As Integer)
On Error GoTo Report_Open_Err
DoCmd.ShowToolbar "iTurns Command Bar", acToolbarNo
DoCmd.Maximize
Select Case Forms!PrintReportsDialog.Sort
Case 1 'IMC Number
Me.JNumber.Visible = False
(NEED CODE HERE)
Case 2 'Jobber Number
Me.Number.Visible = False
(NEED CODE HERE)
End Select

Report_Open_Exit:
Exit Sub

Report_Open_Err:
MsgBox Err.Description
Resume Report_Open_Exit
End Sub

When the report opens the above coode runs and ALWAYS sorts on the Number
field. I need a line of code within each Case that denotes sorting on Number
and JNumber. Can anyone help me? I have no sort order in my report query or
Sorting and Grouping properties defined. Thanks
 

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