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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
Get rid of the Macro and try this:

Private Sub Form_Load()
    Docmd.RunCommand acCmdRecordsGoToNew
End Sub


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.