[AccessD] Solution Looking for a Problem

Drew Wutka DWUTKA at Marlow.com
Wed Jan 21 18:02:13 CST 2009


For doing something like this, you could go even further and do this:

OpenArgs="txtPartNumber=Something|txtXactQty=Somethingelse"

Dim strArray() as String
Dim strItems() as String
Dim I as long
strArray=split(me.OpenArgs,"|")
for i=0 to ubound(strArray)
	strItems=Split(strArray(i),"=")
	Me(strItems(0))=strItems(1)
Next i

That way you can change the open arguments without changing the code
behind the form.  Of course, this only works if you are just setting the
values of controls.

Drew

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin
at Beach Access Software
Sent: Wednesday, January 21, 2009 2:46 PM
To: 'Access Developers discussion and problem solving'
Subject: [AccessD] Solution Looking for a Problem

I needed to pass multiple arguments to a pop up form through OpenArgs.
So I
needed to parse them.  Found this on the web:
 
Dim Hold_OpenArgValues() as String
Hold_OpenArgValues()=Split(Me.OpenArgs, "|")
 
except I DIMmed Hold_OpenArgValues as varOpenArgs as Variant.
 
and walla!  the three comma delimited arguments I passed showed up just
where they were supposed to:
 
    Me.txtPartNumber = varOpenargs(0)
    Me.txtXactQty = varOpenargs(1)
    Me.txtAuditReference = varOpenargs(2)

Note the array is zero based. 
 
One line to parse openargs! (not counting the DIM)  
 
Who knew?
 


 	
	
 

Rocky Smolin

Beach Access Software

858-259-4334

www.e-z-mrp.com <http://www.e-z-mrp.com/> 

www.bchacc.com <http://www.bchacc.com/> 

 

 


-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited.





More information about the AccessD mailing list