Openargs problem

bjreb

Registered User.
Local time
Today, 21:13
Joined
May 7, 2001
Messages
37
Why do I get and error with this code? It says the openargs is null when I run it

Private Sub TXT_SALESMAN_NUMBER_DblClick(Cancel As Integer)
Dim StCustNumber As String

StCustNumber = Me.TXT_SALESMAN_NUMBER.Text
DoCmd.OpenForm "Frm_Slm_Name", acNormal, , , , , StCustNumber
End Sub


Private Sub Form_Open(Cancel As Integer)
Dim StCustNumberSub As String


StCustNumberSub = Forms![frm_slm_name].OpenArgs
DoCmd.GoToControl "Salesnumber"
DoCmd.FindRecord StCustNumberSub, , True, , True, , True

End Sub



Thanks
Andy
 
i haven't tested this...

Code:
Private Sub TXT_SALESMAN_NUMBER_DblClick(Cancel As Integer)

DoCmd.OpenForm "Frm_Slm_Name", acNormal, , , , , Me.TXT_SALESMAN_NUMBER
End Sub


Private Sub Form_Open(Cancel As Integer)

DoCmd.GoToControl "Salesnumber"
DoCmd.FindRecord Me.OpenArgs, , True, , True

End Sub
 
Still null

The openargs is still null. In the openform it shows correctly. When the new form opens it turns to null
 
I also have this problem.

I will reply if I figure it out.
 
I don't know why but on my form in Form_Open me.openargs = null and the Form_Load does not seem to be running. (there is a msgbox in there that is not running)

Made a new form and put the code in Form_Load instead of Form_Open and it worked.

Don't know what was going on with the old form but there you have it.
 

Users who are viewing this thread

Back
Top Bottom