OpenArgs always Null value (1 Viewer)

jepoysaipan

Registered User.
Local time
Tomorrow, 05:36
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
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 12:36
Joined
Aug 30, 2003
Messages
36,126
How is varUserName populated? If you step through the code, does it have a value in the first form?
 

jepoysaipan

Registered User.
Local time
Tomorrow, 05:36
Joined
Nov 4, 2007
Messages
133
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.
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 12:36
Joined
Aug 30, 2003
Messages
36,126
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

Top Bottom