How to add new record by using vba or sql once click a button?

alhabkk

Registered User.
Local time
Today, 11:50
Joined
Sep 9, 2013
Messages
49
How to add new record by using vba or sql once click a button?
 
Hi
Do you want to include data in the new record (as part of the Click event), or just add an empty record?
You can use DoCmd.GoToRecord (see Access Help for syntax), or you can use DoCmd.Execute with SQL (using INSERT statement with data). You can also use a Recordset with rst.AddNew ... rst.Update (rst being the Recordset identifier). Between these two statements, you use as many rst!field = <data> statements as needed to populate fields.
The method you choose depends upon what you want to achieve with the new record.
 

Users who are viewing this thread

Back
Top Bottom