Cannot pass OpenArgs to another form

  • Thread starter Thread starter Ngan
  • Start date Start date
N

Ngan

Hi,
I'm having difficulty passing the OpenArgs parameter to a 2nd form. Here's
what I have:

Form 1 has this line of code in one of its subroutine:
If (kitting) Then
DoCmd.OpenForm "frmWIP_AvailableSerialNumbersToKit", , , , , , "Crazy"
End If

Form "frmWIP_AvailableSerialNumbersToKit" has this in its Load event:
If Not IsNull(Me.OpenArgs) Then Me.RecordSource = Me.OpenArgs

However, OpenArgs keeps being Null and I don't know what I am missing here.
I set a breakpoint at that line to troubleshoot and it shows up as Null the
whole time. Please help.

Thanks much,
 
What you have seems to look OK.

about the only thing that comes to mind here is that perhaps the second form
is already opened? That form
will need to be closed before the openform command will function correctly
and pass a value.

are you sure there's not some other code some or else that are reopens the
form perhaps?


I would try/test in the on-load event go:

msgbox me.OpenArgs
 
Hi,

Thanks so much. That seems to be my problem even though I think I've had
this tested with a dozen permutations already (form opened, not opened, code
breakpoints, no breakpoints etc.). I tested it with the MsgBox and it
prompts ok (about 95% of the time so far).

Thanks for the tip!!!
-ngan
 
Thanks so much for the tip. That seems to be my problem even though I think
I've tested this with a dozen permutations already (form opened, not opened,
breakpoints, no breakpoints etc.). I tested it with the MsgBox and it works
great so far. Now I'm going to pluck in the real code.

Thanks for the help!
-ngan
 
Back
Top