Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sorting for a report specified in report prompt 1

Status
Not open for further replies.

dkwong

MIS
Dec 27, 2001
76
0
0
CA
What's the best way to allow a user to specify what field in a report to sort by in the report prompt? I'm thinking that the SortBy property of the report can be set in some way. I've seen code where the report is opened in design mode, the sort properties are set, and then opened in preview mode. Is there any other way?
 
on the form that opens the report you can have a combo box with the fields of your table (field List)

On the On Open Event of your report use

Me.OrderBy = Forms![MyForm]![Combo]

or prompt user when report is opened

Private Sub Report_Open(Cancel As Integer)
Dim Mysortfield
Mysortfield = InputBox("Enter field to sort by")
Me.OrderBy = Mysortfield
End Sub

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top