New record on open

  • Thread starter Thread starter Bruce
  • Start date Start date
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.
 
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.
 
Back
Top