Using OpenArgs (1 Viewer)

Lissa

Registered User.
Local time
Today, 17:37
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
 

boblarson

Smeghead
Local time
Today, 15:37
Joined
Jan 12, 2001
Messages
32,059
You have to concatenate them and then parse them out on the other side.
 

boblarson

Smeghead
Local time
Today, 15:37
Joined
Jan 12, 2001
Messages
32,059
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.
 

Lissa

Registered User.
Local time
Today, 17:37
Joined
Apr 27, 2007
Messages
114
Hi Bob -
Oh that is clever! Okay I will try that -- Thanks!!
 

boblarson

Smeghead
Local time
Today, 15:37
Joined
Jan 12, 2001
Messages
32,059
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).
 

Lissa

Registered User.
Local time
Today, 17:37
Joined
Apr 27, 2007
Messages
114
Update: It worked perfectly with the comma delimeters :)
Thanks Bob!!!
 

boblarson

Smeghead
Local time
Today, 15:37
Joined
Jan 12, 2001
Messages
32,059
Glad to hear, glad we could help.
 

Users who are viewing this thread

Top Bottom