Using OpenArgs

Lissa

Registered User.
Local time
Today, 02:36
Joined
Apr 27, 2007
Messages
114
Does anyone know if it possible to pass more than one variable using OpenArgs?

DoCmd.OpenForm "frmIncmngInpectLog", acNormal, , , acFormAdd, , Me.txtPackingSlip, Me.txtDateRecd, Me.cbPart

Is not working... :confused: ... unless I only use one argument.
I need to pass all variables....

Thanks
 
You have to concatenate them and then parse them out on the other side.
 
So, actually like:

DoCmd.OpenForm "frmIncmngInpectLog", acNormal, , , acFormAdd, , Me.txtPackingSlip & "," & Me.txtDateRecd & "," & Me.cbPart

And then in the Open event:

Dim varSplit As Variant

varSplit = Split(Me.OpenArgs,",")

Then you can use

varSplit(0) for the first one

varSplit(1) for the second

and

varSplit(2) for the third.
 
Hi Bob -
Oh that is clever! Okay I will try that -- Thanks!!
 
Actually, you might want to use the pipe symbol | for the delimiter instead of a comma as commas may appear in data (at least more likely than the pipe).
 
Update: It worked perfectly with the comma delimeters :-)
Thanks Bob!!!
 
Glad to hear, glad we could help.
yourewelcome2.jpg
 

Users who are viewing this thread

Back
Top Bottom