I'm trying to add a new record in my form using a 'Command Buttom'. Below is my code.
Private Sub Command11_Click()
On Error GoTo Err_Command11_Click
Dim intnewrec As Integer
stDocName = "frmrentals"
DoCmd.GoToRecord , , acNewRec
Exit_Command11_Click:
Exit Sub
Err_Command11_Click:
MsgBox Err.Description
Resume Exit_Command11_Click
End Sub
When I click on the Command Button nothing happens. A new record isn't generated. What am I doing wrong? Thanks in advance for your help.
Private Sub Command11_Click()
On Error GoTo Err_Command11_Click
Dim intnewrec As Integer
stDocName = "frmrentals"
DoCmd.GoToRecord , , acNewRec
Exit_Command11_Click:
Exit Sub
Err_Command11_Click:
MsgBox Err.Description
Resume Exit_Command11_Click
End Sub
When I click on the Command Button nothing happens. A new record isn't generated. What am I doing wrong? Thanks in advance for your help.