Form On Load

I have a form that when loads, the last entry(record) is still showing.  I need the form to load clean.  The on load event is an embedded macro in which I copied from a template.  I really don't like these macros.....   How can I have the form clear itself on loading with VBA.  Can you have a macro on load and also vba.  I don't even know how to copy the embedded macro for the on load event for the form to show you.  Please advise.  Thanks
Who is Participating?
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
Get rid of the Macro and try this:

Private Sub Form_Load()
    Docmd.RunCommand acCmdRecordsGoToNew
End Sub

zpotokAuthor Commented:
Not being familiar with macros, I'm sure it is for something important (not sure what though) and I don't think I should just 'get rid' of it.  I would post the macros but how do I copy and paste for you to see?
Jeffrey CoachmanMIS LiasonCommented:
<I have a form that when loads, the last entry(record) is still showing. >
That's odd... typically forms open with the first record displaying.

Do you have a Date Created field you are sorting on?


If your looking for a form to open clean {for data entry}
you could set the form's property  DATA ENTRY = YES

This will always bring up the form clean to enter data

Hope this helps

zpotokAuthor Commented:
I deleted the on load macro and substituted your vba and things seem to be working ok.  I'm still concerned what the heck the on load  macro was for.  Quess I'll make another post.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.