Go to NewRecord on pressing the save button

barathi23

New member
Local time
Today, 19:09
Joined
May 7, 2016
Messages
4
I m new to access and vba.
I have created a form to enter information for records. I have created a button named it Save, i have entered a code to check a condition and update a boolean variable. Since i have no knowledge in VB programming i got that code in a previous thread here. The form saves the information successfully.

I would like the form to open a new record at the end of this. Some one please help with this VB code to go to NewRecord.
 
If it is a bound form, just add the code;
Code:
docmd.GoToRecord,,acNewRec

If it is an unbound form, just set the controls to blank (or a default value) and set focus on the first control
 
in form design
turn on USE CONTROL WIZARDS
grab a button, put on form
the wizard will ask what you want
select: record operations (left side)
select: Add New Record (right side)
click finish

now look at the code behind the button.
grab that line, copy , then paste it in your SAVE button event
 
docmd.GoToRecord ,,acNewRec
 
Thanks all of you. Below command helped.

docmd.GoToRecord ,,acNewRec
 

Users who are viewing this thread

Back
Top Bottom