Opening a new record form but allowing searches

F

Fallout

I changed the "Data Entry to Yes" to have my forms open for new records, but
it seems to have disabled my ability to move from record to record or allow
for searches. Is there another way that I could have set it up so that it
allows for both?
 
J

John W. Vinson

I changed the "Data Entry to Yes" to have my forms open for new records, but
it seems to have disabled my ability to move from record to record or allow
for searches. Is there another way that I could have set it up so that it
allows for both?

That's what Data Entry does.

You can get the best of both by putting a line of code or a macro in the
form's Load event to move to the new record:

Private Sub Form_Load()
DoCmd.GoToRecord acForm, Me.Name, acNewRecord
End Sub
 
V

VWP1

Please forgive me for being so bold as to this response. I am not that great
at VBA, but I just used the Button Wizard, and got this code; it closes the
form and reopens it in data entry mode. Thanks for letting me intercede.

Private Sub ButtonAddNewRecord_Click()
On Error GoTo Err_ButtonAddNewRecord_Click

DoCmd.GoToRecord , , acNewRec

Exit_ButtonAddNewRecord_Click:
Exit Sub

Err_ButtonAddNewRecord_Click:
MsgBox Err.Description
Resume Exit_ButtonAddNewRecord_Click

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