Adding new records

gguy

Registered User.
Local time
Today, 17:43
Joined
Jun 27, 2002
Messages
104
I want to add a record to the table but not leave the form.

I am using a command button to close the form and I realize that the record will be saved when the form is closed.

I also have a command button to save the record and this button does save the record but after the record is saved I want the form to clear so that a new record can be entered.

Thanks, GGuy
 
in a new line, just under your save command do:

DoCmd.GoToRecord , , acNewRec

then once the record is saved, it will take the user to a blank record.
 
This is what I have in the OnClick function;

Private Sub Add_record_Click()
On Error GoTo Err_Add_record_Click

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

DoCmd.GoToRecord , , acNewRec

Exit_Add_record_Click:
Exit Sub

When I click the add record button it changes to record 2 of 2 and all the form fields remain filled. Thanks again, GGuy
 

Users who are viewing this thread

Back
Top Bottom