sort ascending

G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top