I have a main form with a datasheet subform that is a reflection of a large table. I would like to sort the fields based on a user's field selection from a combo box. The layout is such: My main form, with the subform in it, a combo box and a button at the bottom of the main form. When the user selects a field name from the combo box and hits the button, the subform will sort accordingly. So far, I've been able to sort it ascending (default), but not descending. Here is my code:
Private Sub Command17_Click()
Me![HPK_Providers subform].Form.OrderByOn = True
Me![HPK_Providers subform].Form.OrderBy = Combo30
End Sub
Easy code, and it works like a charm for sorting ascending, but how can I make this sort descending?
Note: I've tried quotes (i.e. *.orderby = "[Combo30] desc") and brackets and all sorts of things. Also using Access 2K3.
Start Free Trial