How do I add ORDER BY [AdjusterLastName] in the following ??
Adodc1.Recordset.Filter = "AdjusterLastName = '" & DataCombo1.Text & "'"
Thanks for any and all help :)
Printable View
How do I add ORDER BY [AdjusterLastName] in the following ??
Adodc1.Recordset.Filter = "AdjusterLastName = '" & DataCombo1.Text & "'"
Thanks for any and all help :)
Isn't that a SQL Command?
I Think This is what you want
VB Code:
adodc1.Recordset.Open "Select * From Table ORDER BY [AdjusterLastName]
yes it is a SQL command but if I use
adodc1.Recordset.Open "Select * From Table ORDER BY [AdjusterLastName]
It works fine till I filter the recordset then it will not ORDER BY
I have to filter the recordset since the user selects a Client and based on that client only those Adjusters associated with that client appear in the DataCombo Adjusters list hence the original problem where the recordset is filtered by a Client DataCombo.
I dunno why it doesn't maintain the original ORDER BY when it is later filtered
TailGun
I had a situation like this before and solved closing the recordset and reopening with the filter and the ordering.
VB Code:
adodc1.Recordset.Close adodc1.Recordset.Open "Select * From Table WHERE AdjusterLastName = '" & DataCombo1.Text & "' ORDER BY [AdjusterLastName]"
thanks LucianoBraatz
that did the trick