Solved Order By in a continuous form with the value of combobox (1 Viewer)

owner

New member
Local time
Today, 02:08
Joined
Aug 12, 2020
Messages
6
Dear All,

When I have a continuous form that have a combobox that combobox as usual contains 2 columns. first used to be stored in the table and the second appears to the end user

I need that continuous form to be sorted by the second column that shown to the end user in ascending order

Can anyone help?
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 17:08
Joined
Oct 29, 2018
Messages
21,454
Dear All,

When I have a continuous form that have a combobox that combobox as usual contains 2 columns. first used to be stored in the table and the second appears to the end user

I need that continuous form to be sorted by the second column that shown to the end user in ascending order

Can anyone help?
Hi. You could try adding the second column source in the query for the form, so you can sort by it.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 08:08
Joined
May 7, 2009
Messages
19,229
assumed that the Field in the Second combo's column is the RecordSource of the Form.
on the AfterUpdate Event of the combo:
Code:
If Len(Me.yourCombo & "") > 0 Then
    Me.OrderBy = Me.YourCombo.Column(1)
    Me.OrderByOn = True
Else
    Me.OrderByOn = False
End If
 

Users who are viewing this thread

Top Bottom