How do I tell Access to Create a new record when form is opened?

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

Guest

I'm trying to tell MS access to create a new record automatically when "new
account" is clicked on the switchboard. then I want to set a button for save
record. PLEASE HELP!
 
Maybe you look for

DoCmd.GoToRecord , , acNewRec

somewhere inside your newaccount_Click event (assuming it is a button) ?

Gina
 
I'm trying to tell MS access to create a new record automatically when "new
account" is clicked on the switchboard. then I want to set a button for save
record. PLEASE HELP!

What do you want this new record to *contain*? It must have SOMETHING
in it - you can't (well, you can, but you shouldn't) simply create a
new empty record and save it to disk.

Open the Form in design view and set its Data Entry property to True,
and it will open at the (empty) new record ready for the user to start
typing into it. No Save button is usually necessary; if the user
closes the form or moves off the record, it's saved automatically. If
you do want one anyway, put in its Click event code like

Private Sub cmdSave_Click()
If Me.Dirty Then
Me.Dirty = False
End If
End Sub

John W. Vinson[MVP]
 
Back
Top