martinargimon
Member
HI chandoo
I have attached an extract of my file.
I've created a Form called 'Orders' and at the bottom a search Combo box ( with three options). Depending which option you choose the .list is loaded onto the control
My problem is actually sorting the list before is loaded onto the Combo box. The first Option by 'Order Number' ( is already sorted as per the table when the form is initialised, so no problem there), but the other 2 Options (by 'Policy Number' or By 'Last name') need to be sorted beforhand.
An lastly the last Option By 'last Name' I would like to add the 'Order number' corresponding to the Customer so i can select the correct one, since one customer can have more than one (1) order number.
Hope i am clear.
Can you help , please? Thanks
p.s: Below the code for the search By 'Last Name', ( as you can see with my solution indented which does not work).
Many Thanks
Martin
I have attached an extract of my file.
I've created a Form called 'Orders' and at the bottom a search Combo box ( with three options). Depending which option you choose the .list is loaded onto the control
My problem is actually sorting the list before is loaded onto the Combo box. The first Option by 'Order Number' ( is already sorted as per the table when the form is initialised, so no problem there), but the other 2 Options (by 'Policy Number' or By 'Last name') need to be sorted beforhand.
An lastly the last Option By 'last Name' I would like to add the 'Order number' corresponding to the Customer so i can select the correct one, since one customer can have more than one (1) order number.
Hope i am clear.
Can you help , please? Thanks
p.s: Below the code for the search By 'Last Name', ( as you can see with my solution indented which does not work).
Code:
Private Sub OptionButton_LastName_Click()
Me.CmbSearchBy = ""
lr = Sheets("Orders").Cells(Rows.Count, 7).End(xlUp).Row
Me.CmbSearchBy.RowSource = "Orders!G8:G" & lr
'Me.CmbSearchBy.ColumnCount = 7
'Me.CmbSearchBy.ColumnWidths = "30,20,10,10,20,20,20"
'Me.CmbSearchBy.BoundColumn = 1
End Sub
Many Thanks
Martin