I have applied a filter (to sort on multiple fields) in the data base. I want
Access to apply the filter (re-sort) every time a new record is added in the
datasheet view. HOW?
You cannot sort "a data base". Jargon alert: in Access, a "Database"
is the .mdb file, a container for multiple Tables, Forms, Reports,
Queries and other objects.
I'd suggest that you not use the table datasheet at all. It's too
limiting. Instead, use a Form (which could be a datasheet view form if
you wish); it should be based on a Query sorting the records in the
order you desire. Put code in its AfterInsert event
Private Sub Form_AfterInsert()
Me.Requery
End Sub
Note that this will get timeconsuming when the table grows large, and
that it will always jump back to the first record when you requery.
You can put additional code
DoCmd.GoToRecord acForm, Me.Name, acLastRecord
to jump to the last record, but it will appear at the top of the
screen.
John W. Vinson[MVP]