command button for save

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?
 
J

John W. Vinson

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
 

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