S
Slez via AccessMonster.com
I have a command button, cmdAddClient, on a mainform, frmClientMain. I would
like to make it so when users click it, it takes you to the new record in a
subform called frmClientList.
I tried the following code, but get an error message that I have the wrong
number of arguments. I'm quite certain the problem lies in my "DoCmd..."
line of code. Can anyone help with the code that is required to accomplish
this? Thanks in advance!!
Private Sub cmdAddClient_Click()
On Error GoTo Err_cmdAddClient_Click
Dim stDocName As String
stDocName = "frmClientList"
DoCmd.GoToRecord , , acNewRec, stDocName
Exit_cmdAddClient_Click:
Exit Sub
Err_cmdAddClient_Click:
MsgBox Err.Description
Resume Exit_cmdAddClient_Click
End Sub
like to make it so when users click it, it takes you to the new record in a
subform called frmClientList.
I tried the following code, but get an error message that I have the wrong
number of arguments. I'm quite certain the problem lies in my "DoCmd..."
line of code. Can anyone help with the code that is required to accomplish
this? Thanks in advance!!
Private Sub cmdAddClient_Click()
On Error GoTo Err_cmdAddClient_Click
Dim stDocName As String
stDocName = "frmClientList"
DoCmd.GoToRecord , , acNewRec, stDocName
Exit_cmdAddClient_Click:
Exit Sub
Err_cmdAddClient_Click:
MsgBox Err.Description
Resume Exit_cmdAddClient_Click
End Sub