OpenArgs always Null value

jepoysaipan

Registered User.
Local time
Tomorrow, 02:21
Joined
Nov 4, 2007
Messages
133
Hi Guys,

I have 2 form (Form1) is a log-in form, (Form2) is the Data Entry. After Authenticating the user on Form1 I used DoCmd.OpenForm "MyFormName", , , , , , varUserName, then open Form2 with following code on OnOpen event:

If Not IsNull(Me.OpenArgs) Then
Me.txtUser.Value = Me.OpenArgs
Me.Requery
Else
MsgBox ("Null")
End If

but it always shows the msgBox "Null"

What seems to be the problem with this?

Thanks in advance.

Jeff
 
How is varUserName populated? If you step through the code, does it have a value in the first form?
 
Hi Paul,

Thanks for your time, I've assigned the value of the combo box on Form1 to varUserName before opening Form2. But I can't seem to get the value I passed.
 
Have you set a breakpoint and stepped through the code? You need to make sure you have the value at step A before trying to figure out why it's not at step B.
 

Users who are viewing this thread

Back
Top Bottom