G
Guest
The following code is an event procedure for form open. I don't know if it
is correct or not, but I am trying to open the client table when information
in a related table is being added and the client doesn't exist. If the
client exists, the client form is opened so that the user can add the client.
I got that to work ok, but the form was on a client, I wanted it to go to a
new record so that the user doesn't have to. The code below generates an
error when the docmd is run. the error is "the object "Clients" isn't open.
The clients table is the recordsource for this form. What am I doing wrong?
Private Sub Form_Open(Cancel As Integer)
Dim strOpenCondition As String
strOpenCondition = Forms![frm lcm clients].OpenArgs
Select Case strOpenCondition
Case "GoToNew"
DoCmd.GoToRecord acDataTable, "Clients", acNewRec
End Select
End Sub
is correct or not, but I am trying to open the client table when information
in a related table is being added and the client doesn't exist. If the
client exists, the client form is opened so that the user can add the client.
I got that to work ok, but the form was on a client, I wanted it to go to a
new record so that the user doesn't have to. The code below generates an
error when the docmd is run. the error is "the object "Clients" isn't open.
The clients table is the recordsource for this form. What am I doing wrong?
Private Sub Form_Open(Cancel As Integer)
Dim strOpenCondition As String
strOpenCondition = Forms![frm lcm clients].OpenArgs
Select Case strOpenCondition
Case "GoToNew"
DoCmd.GoToRecord acDataTable, "Clients", acNewRec
End Select
End Sub