[AccessD] OpenArgs issue in A2207

David McAfee davidmcafee at gmail.com
Mon Jun 14 16:13:39 CDT 2010


You're correct, I realized that after I pressed send but I was still
getting a null, until I put NZ around it.

This returns correctly:
docmd.OpenForm "frmRpoPartsHistory",,,,,,"966"

Private Sub Form_Open(Cancel As Integer)
Debug.Print Nz(Me.OpenArgs, "")
End Sub

Prints: 966

This does not:
docmd.OpenForm "frmRpoPartsHistory",,,,,,"966"
Private Sub Form_Open(Cancel As Integer)
Debug.Print Me.OpenArgs
End Sub

Prints: Null





On Mon, Jun 14, 2010 at 1:52 PM, Gustav Brock <gustav at cactus.dk> wrote:
> Hi David
>
> OpenArgs is a string ...
>
> DoCmd.OpenForm "frmRpoPartsHistory",,,,,,"966"
>
> To read it you can do:
>  strOpenArgs = Nz(Me.OpenArgs)
> or:
>  lngOpenArgs = Val(Nz(Me.OpenArgs))
>
> /gustav
>
>
>>>> davidmcafee at gmail.com 14-06-2010 22:16 >>>
> I'm having a bit of cerebal flattulance this morning.
>
> I'm calling (both via code or the immediate window):
> docmd.OpenForm "frmRpoPartsHistory",,,,,,966
>
>
> Private Sub Form_Load()
> Debug.Print Me.OpenArgs
> End Sub
>
> Private Sub Form_Open(Cancel As Integer)
> Debug.Print Me.OpenArgs
> End Sub
>
> Both subs print Null
>
> Am I doing something wrong, or do OpenArgs work differently in A2007?
>
> Is this Access telling me that I've been away too long?
>
> D
>
>
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>




More information about the AccessD mailing list