Code to save table in my form?

G

GoBrowns!

I have a form with a subform - the form is merely a combo box and EmployeeID
field, the subform is a table. When you choose an employee from the combo
box, the subform (table) is filtered to show only entries for that employee.
I want the user to be able to edit the records in the table/subform from this
form, then save their changes. I created a command button to allow the user
to save their changes.... with the following code:

Private Sub cmdSave_Click()
' Save changes made to the attendance records.
DmCmd.RunCommand acCmdSave (or acCmdSaveForm???)
End Sub

I keep getting an error that I need an Object.... I am confused.

How do I fix the code so that the save is made?

My ultimate goal is that the user can use the save button, get a MsgBox
created by me letting them know the save has been completed... and NOT see
any system generated messages. Any ideas???

Thanks!!!
 
B

Beetle

DoCmd.RunCommand acCmdSaveRecord

Or

If Me.Dirty Then Me.Dirty = False

Although, in a typical Access application (with bound forms)
you don't need to do anything explicit to save the record. It is
saved automatically when you move to another record, close
form, etc.
 

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