Include date sorting in a VBA filter button

gojets1721

Registered User.
Local time
Today, 01:19
Joined
Jun 11, 2019
Messages
430
Hi so my form has a button that when pressed, it filters down to certain entries. However when it filters, it no longer sorts the entries from oldest to newest by date. It's just randomly mixed up. Is there anyway to include something in the code that will sort from oldest to newest by date?

The VBA code that I am using for the button is:

Code:
Private Sub btnNotStarted_Click()
    DoCmd.ApplyFilter , "[Status]= 'Not Started'"
End Sub
 
Can you add to the code:

DoCmd.SetOrderBy "[Entry Date Fieldname] DESC"
 
That worked!! Thanks!
 

Users who are viewing this thread

Back
Top Bottom