Sorting a Field

Rusty

Registered User.
Local time
Today, 12:30
Joined
Apr 15, 2004
Messages
207
Hey Guys,

I have a comand button on a form and I want it to select a field called [DateOfMI] and sort it (in ascending order).

So far I have got the code below, but what do I need to put before it to select the [DateOfMI] field?

Any ideas?

Rusty
:D


Code:
Private Sub cmdSortDateMI_Click()

    DoCmd.RunCommand acCmdSortAscending

End Sub
 
it would make sense to me that you would have to set the focus to the control that you want to sort on.
 
Thanks for that,

I managed to use the code below to do just that.

Cheers,

Rusty
:D


Code:
Private Sub cmdSort_Click()
    Fieldname.SetFocus
    DoCmd.RunCommand acCmdSortAscending
End Sub
 

Users who are viewing this thread

Back
Top Bottom