PDA

View Full Version : How so you create a save button and add new button on a form using vba?



wedd
12-16-2010, 08:59 AM
Hi, I've developed a database with many customers. I'd like to create a save button, as well as add a new customer button when he or she joins my organistaion. I'm a bit of a novice/intermediate level user of vba and I don't really want to use the button wizard feature. Do you know vba code I can use to save the details of a new record on a form as well as add a new customer to my database? If you have any examples of code to do these different funtions that would be very helpful.


Thanks for your conributions!:friends:

Imdabaum
12-16-2010, 09:50 AM
If you don't want to use the wizard and really want to use VBA, then I would suggest making a recordset.


rst = DAO.Recordset

with rst
.AddNew
.Field1() = x
.Field2() = y
.Field3() = z
'etc
.Update
End with


But if you're going to do that, you might as well be using the save button wizard.

May I ask, why the button wizard doesn't satisfy your needs?