New record on open

B

Bruce

I have a form (Access 2002 or 2007 with latest service packs, Windows XP
professional sp 3) that I want to go to new record on open. I am trying to
get away from using macros and want to use more event procedures which means
using more Visual Basic. I have tried using Access help (including on line)
to no avail. Could someone point me in the right direction as to how I would
code the Form_Open. I have even tried going to the Northwind database to see
if this procedure was used in any of their examples (they did not). Pointing
me in the right direction would help me learn more about how to code using
Visual Basic.
 
K

Ken Snell MVP

Assuming that you want to see previous records in the form, I'd use this
code in the form's Load event:

Private Sub Form_Load()
Me.Recordset.AddNew
End Sub


Else, if you just want to show the form with a new record, set the form's
Data Entry property to Yes.
 

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

Top