Solved Order By in a continuous form with the value of combobox

owner

New member
Local time
Today, 08:25
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?
 
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.
 
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

Back
Top Bottom