Button actions on form...

M

msk

hi there, new to access and have a quick question. I am creating a very
simple data entry form, and have a couple buttons that are included at the
bottom of the form. After entering the data into the textboxes, there is a
SAVE record button and then NEXT record button. Basically, I'm wondering how
you could combine the actions of these two buttons. When the user is done
entering a record, I want to save it and then automatically jump to a new
(blank) record on the data entry form. So I would like to take a 2 step
process (user clicks SAVE, and then clicks NEXT and then starts entering the
data for the new record) and turn it into 1 step. One other thing, how would
you automatically put the focus back on the first textbox when you hit the
SAVE/NEXT Button? Basically, just trying to streamline the data entry
process. Thanks for any help...
 
A

Al Campagna

msk,
With one button named cmdNewRecord, and using the OnClick event...

Private Sub cmdNewRecord_Click()
DoCmd.GoToRecord, , acNewRec
End Sub

Whenever you move from record to record,
the record you are leaving is Updated by Access, (if Dirty) so no need to
code for it.

--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
S

Stockwell43

Hi msk,

I believe your referring to the Add Record button. Go to your wizard and
click on the button icon to create a new button. When the Command Button
Wizard opens, click on Record Operations on the left and then to the right
you should see Add New Record. Click on that and then click on Next until you
go through the stages and then click Finish.
 

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