This is the line which passes the argument to the "child"开发者_开发百科 form:
DoCmd.OpenForm "Main", acNormal, , , , acWindowNormal, tr.GetEmployeeName(uname)
Then this is the code for when the "child" form loads:
Private Sub Form_Load()
Dim i As String
i = CStr(Login.OpenArgs)
MsgBox i
End Sub
Thanks a lot!
The argument is already passed as a string, and is a property of the "child" form:
Private Sub Form_Load()
Dim i As String
i = Me.OpenArgs
MsgBox i
End Sub
EDIT: I almost missed this - it's been a while . . .
More editing: It looks like you are treating the OpenArgs as a property of the Parent form. I shall assume your Parent form is "login", and your child form is "Main", since you appear to be invoking a Form named "Main" in that line of code.
The openArgs is a property of the form now opening, passed to the child from the parent. Therefore, you reference the OpenArgs property as shown above.
Unless I am missing something, anyway . . .
精彩评论