command button for save

  • Thread starter Thread starter ngeng ngok
  • Start date Start date
N

ngeng ngok

ive created a form in microsoft access 2003. that is the blank form n
will be use as a new data entry form. then, ive created a command
button for the saving data purpose. but i dont know the coding for the
saving purpose. i want to save it to my database. how can i do that?
 
ive created a form in microsoft access 2003. that is the blank form n
will be use as a new data entry form. then, ive created a command
button for the saving data purpose. but i dont know the coding for the
saving purpose. i want to save it to my database. how can i do that?

You don't actually *need* a button - just moving off the record or onto (or
off of) a subform, or closing the form, will save the record.

If you do want a button anyway, its click event could call a SaveRecord macro,
or if you prefer VBA code,

Private Sub cmdSave_Click()
DoCmd.RunCommand acCmdSaveRecord
End Sub
 
Back
Top