View Full Version : How to Create New record programmatically
ganesh3084
07-07-2011, 12:14 AM
Hi all !!!!!!!! I need to create a new record using VBA. I have tried using the following code. But it didnt work.
Private Sub btnNew_Click()
DoCmd.GoToRecord , , acNewRec
End Sub
Plz suggest me
HiTechCoach
07-09-2011, 11:57 AM
Do you get an error message?
Is the record set updateable?
Is the form set to allow additions?
Have you tried using the command button wizard?
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
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.