Add a new record

C

Craig

I have a button that says add to inventory. When i click on this i need it to
go to a new blank record. Is it just a case of running a macro for the GoTo
function?

Thanks
 
S

Stockwell43

Put this in the On Click Event of your button:

DoCmd.GoToRecord , , acNewRec
 
C

Craig

Hi,

When i put the code in to the click event it says macro cannot be found.
What am i doing wrong?

Thanks for your help
 
S

Stockwell43

Hi Craig,

Did you create a new button or did you have an existing one you are trying
to use? Couple of things:

If you placed a blank button on your form, go into the On Click event and
select Event Procedure from the drop down and then click on the three dots to
the right then paste the code I gave you.

OR

You can delete your current button(provide nothing is attached to it) start
a new button and from the wizard select Add a New Record and the wizard will
do everything for you. All you'll need to do is place it on your form.

Let me know if you have any problems.
 
Top