Sort on form when copying record

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

On my form, I have a "Duplicate Record" Button that automatically creates a
new record with most of the same data as the current record. Only problem is
that it makes this new record the last one. So, what I need is code that
will resort the form after the new duplicate record is created. This is what
I tried and keep getting an error:

sortCriteria = "Grants.[Grantor Number], Grants.[Date Information Entered]"
DoCmd.ApplyFilter , sortCriteria

Thanks for the help! Oh, I guess I should also mention that the new
duplicate record should be the one that is showing on the form after the code
runs. Thanks again!
 
ApplyFilter has nothing to do with sorting: it's how you limit which rows
should be returned.

Assuming that the recordsource of your form already has an ORDER BY clause
in it, a simple

Me.Requery

should be all you need.
 

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

Back
Top