Move To A New Record
acCmdRecordsGoToNew
This code moves you to a new record for the form. The code is designed to be behind a button called cmdNew.
'***************** Code Start *******************
'This code was originally written by Terry Wickenden.
'It is not to be altered or distributed,
'except as part of an application.
'You are free to use it in any application,
'provided the copyright notice is left unchanged
Private Sub cmdNew_Click()
On Error GoTo ErrNew
DoCmd.RunCommand acCmdRecordsGoToNew
Exit Sub
ErrNew:
Select Case Err
Case 2046
'Command not available
MsgBox "You cannot add a record at this time." , vbInformation, "Not Available"
Case Else
MsgBox Err.Number & ":-" & vbCrLf & Err.Description
End Select
End Sub
'****************** Code End ********************