PDA

View Full Version : How to write VBA code in AddNew Button In Access DBA



ganesh3084
07-07-2011, 01:50 AM
Hi All

Could you please help me the way to writing VBA code in Addnew Button in Access 2003.

HiTechCoach
07-09-2011, 11:59 AM
I would use the command button wizard. Select record operations then add record.

Example code:



Private Sub Command23_Click()
On Error GoTo Err_Command23_Click


DoCmd.GoToRecord , , acNewRec

Exit_Command23_Click:
Exit Sub

Err_Command23_Click:
MsgBox Err.Description
Resume Exit_Command23_Click

End Sub