Ideally what you would need to do is to set the Focus to
the field you would like to sort.
i.e
Then use the following code behind a Command Button for
instance and this will toggle the Ascending and Descending:
Static bTitleAscending As Boolean
Me!Title.SetFocus
If Not bTitleAscending Then
DoCmd.RunCommand acCmdSortAscending
bTitleAscending = True
Else
DoCmd.RunCommand acCmdSortDescending
bTitleAscending = False
End If
Ideally what you would need to do is to set the Focus to
the field you would like to sort.
i.e
Then use the following code behind a Command Button for
instance and this will toggle the Ascending and Descending:
Static bTitleAscending As Boolean
Me!Title.SetFocus
If Not bTitleAscending Then
DoCmd.RunCommand acCmdSortAscending
bTitleAscending = True
Else
DoCmd.RunCommand acCmdSortDescending
bTitleAscending = False
End If
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.