Form refresh

  • Thread starter Thread starter Larry
  • Start date Start date
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!
 
-----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
 
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
 
Back
Top