sort ascending

J

JOe

I have a form in Datasheet view
I need to do a sort ascending as soon as it open
How can I do a sort ascending programmatically
Thanks
 
G

Guest

You need to set the OrderBy property for the form.

If you go to design view and then browse the FORM
properties you will see OrderBy under the Data tab.

Good luck

Robin
 
A

Allen Browne

Create a query that sorts as you wish, and use that as the RecordSource of
the form.

If you want to do it programmatically:

Private Sub Form_Open(Cancel As Integer)
Me.OrderBy = "SomeField"
Me.OrderByOn = True
End Sub
 
Top