Solved Sorting Report from Combo Box (1 Viewer)

Pop_Access

Member
Local time
Today, 16:29
Joined
Aug 19, 2019
Messages
66
Hi;
I have a form that has a few parameters on it, and it has a button to open report; I want to add a combo box on the form (cmbsort) to allow end user sort the data on the report based on the combo box value.

Thank you
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 23:29
Joined
Sep 12, 2006
Messages
15,614
it gets quite difficult programming all the sort orders that a user might want from a report.
In the end it can be a lot quicker and simpler to provide a spreadsheet extract, and let the user extract the information he wants.
 

Pop_Access

Member
Local time
Today, 16:29
Joined
Aug 19, 2019
Messages
66
thanks for All,
I have used @CJ_London solution,

On the (On Open) event of the report you can set the order in this way

Code:
[Private Sub Report_Open(Cancel As Integer)

Dim sort As Variant
sort = Forms!frm_name.combo_name.Value

    If sort <> 0 Then
        Me.OrderBy = sort
    Else
        Me.OrderBy = "field_name"
    End If

End Sub
 

Users who are viewing this thread

Top Bottom