Open Form to Create New Record

  • Thread starter Thread starter Mary Hartman
  • Start date Start date
M

Mary Hartman

I have designed a control panel and created command buttons to open
forms.

Some of those form I would like to open only to create a new record.

Is that possible? I haven't been able to find a method of doing that.
 
In the form's Design View, goto Properties > Data and set Data Entry to YES

or

Private Sub Form_Load()
Me.DataEntry = True
End Sub

or, to open from a button

Private Sub OpenFormToAdd_Click()
DoCmd.OpenForm "YourQueryName", , , , acFormAdd
End Sub
 
Forgot this one, Mary. The previous examples open the file ready for a new
record to be entered, but do not allow for other records to be viewed. This
final code opens the form for adding a new record, but then allows the user
to navigate other records in the db.

Private Sub Form_Load()
DoCmd.GoToRecord , , acNewRec
End Sub
 
Back
Top