You should in the future make a new thread for a new question, but maybe some nice Moderator will split it :P
Anyways:
Adding a button, btn_New, caption "New", click the Events, and the OnClick button to get the code window and write:
- Private Sub btn_New_Click()
-
Me.AllowAdditions = True
-
DoCmd.GoToRecord , , acNewRec
-
End Sub
This will allow user to go to a new record, but we also want to prevent him from navigating by mousewheel to a new record (maybe you don't care, depends on your application)
So in our Form_Current() we add:
- Me.AllowAdditions=Me.NewRecord
This will turn off additions unless we are looking at a new record. Access can be a bit funny though, if you have a form with no records yet, and AllowAdditions=False, because then it will hide the entire form (including the buttons...) so to prevent this case from happening, we do:
Select Form->events->OnLoad and write:
- Private Sub Form_Load()
-
Me.AllowAdditions=True
-
End Sub