I have tried to pass on a string to a new form using the OpenArgs, but, being new to all this, am unable to see what is wrong with the syntax. This is the code for the open:
Private Sub cmdTask_Click()
DoCmd.OpenForm stDocName, acNormal, , , , , "new"
End Sub
and this is the code where I wanted to see what I had:
Private Sub Form_Open(Cancel As Integer)
Dim stOpenArgs As String
stOpenArgs = Me.OpenArgs
MsgBox stOpenArgs
End Sub
When I do the Form_Open the form doesn't even open, but if I remove the code it opens fine, so there is a syntax error. I know that the answer is probably something very simple, but it continues to elude me. Help!
Private Sub cmdTask_Click()
DoCmd.OpenForm stDocName, acNormal, , , , , "new"
End Sub
and this is the code where I wanted to see what I had:
Private Sub Form_Open(Cancel As Integer)
Dim stOpenArgs As String
stOpenArgs = Me.OpenArgs
MsgBox stOpenArgs
End Sub
When I do the Form_Open the form doesn't even open, but if I remove the code it opens fine, so there is a syntax error. I know that the answer is probably something very simple, but it continues to elude me. Help!