Form refresh

L

Larry

Hi,

Is there a way to save the records in the form and have
the form refresh? I guess what I am looking for is when
someone hit the Save Record button I created, it will save
the data, and clear the form so they can enter another
information.

Thanks in advance!
 
R

Roxie Aho

-----Original Message-----
Hi,

Is there a way to save the records in the form and have
the form refresh? I guess what I am looking for is when
someone hit the Save Record button I created, it will save
the data, and clear the form so they can enter another
information.

Thanks in advance!
.
Private Sub cmdSaveTheRecord_Click()
DoCmd.RunCommand acCmdSaveRecord
DoCmd.GoToRecord , , acNewRec 'Goes to new record
DoCmd.GoToControl ("ID") 'Name of control you want to
have the focus.
End Sub

Access saves a record when the user leaves the record. So
in most cases, there's no need from the DoCmd....acCmdSave.

Yo also may not need the GoToControl except in special
cases. Access goes to the first control in the tab order
when it moves to a new or different record.

This example sends the user to a new blank record. You
could us DoCmd.GoToRecord , , acNextRec, which takes the
user to the next record. You can also uses Previous,
First and Last.

Roxie Aho
roxiea at usinternet.com
 
J

Jim/Chris

If you go to add a new record the record is automatically
saced but here try

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,
acMenuVer70
DoCmd.GoToRecord , , acNewRec

Jim
 

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