Open Form to Create New Record

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.
 
M

missinglinq via AccessMonster.com

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
 
M

missinglinq via AccessMonster.com

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
 

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