User ordered report

SueBK

Registered User.
Local time
Tomorrow, 09:32
Joined
Apr 2, 2009
Messages
197
I have a couple of very simple reports with two or three fields (eg list of road names and their government assigned numbers). These are run from a button on my main form.

What is the easiest way to give users the ability to order these reports? Eg sometimes I want to look at the list of roads by road name; sometimes by road number.
 
Paul, thank you for replying. Unfortunately, your link leads me to a "there is no post" message.
 
Interesting, since I went there yesterday to get it. Something happened between then and now. Anyway, I often use code like this in the open event of the report, which looks at a form where the user made selections:

Code:
Private Sub Report_Open(Cancel As Integer)
  Select Case Forms!fraReports.frmGrouping
    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
 

Users who are viewing this thread

Back
Top Bottom