View Full Version : append to a table using code


sabi
10-24-2006, 01:50 AM
how to add records to an access table using code?

jeremypaule
10-24-2006, 06:14 AM
Make an append query then you can use code like this,


Private Sub Run_Click()
On Error GoTo Err_Run_Click

Dim stDocName As String

stDocName = "APPENDQUERYNAME"
DoCmd.SetWarnings False
DoCmd.OpenQuery stDocName, acNormal, acEdit
DoCmd.SetWarnings True

Exit_Run_Click:
Exit Sub

Err_Run_Click:
MsgBox Err.Description
Resume Exit_Run_Click

End Sub