[AccessD] Feeding an paramarray to a paramarray

jwcolby jwcolby at colbyconsulting.com
Wed Mar 12 15:52:07 CDT 2008


that is exactly what it is for and when it is needed it works well.  For
example I so stuff like allowing a form open for a set of Groups in my
security.  Thus in the form's OnOpen I call a function and pass in all the
groups that are allowed to open the form.  If the currently logged in user
is in any of those groups the form stays open else the cancel is set and the
OnOpen is exited.  There is no way in advance to know what specific groups
can open the form, it is hardcoded in the open event of each form.

In cases like that it works quite well.  

John W. Colby
Colby Consulting
www.ColbyConsulting.com 
-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka
Sent: Wednesday, March 12, 2008 4:35 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Feeding an paramarray to a paramarray

I hear ya. Not sure where I would use a ParamArray in stuff I do now
anyways.  It's a neat idea, but it seems that it is really designed to allow
you to have multiple arguments to a function, without having to define them.

Most of my logic is done in classes now, any functions I use are pretty
straightforward, no need to be all that flexible.

Drew


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby
Sent: Wednesday, March 12, 2008 1:22 PM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Feeding an paramarray to a paramarray

Well I'm sure it would except I already have a solution that is in place and
works - unpacking the array into a collection and passing the collection
from that point.  A collection can be passed to a function that is expecting
a collection, which can pass it to a function expecting a collection.
IOW
from the point that the array is unpacked into a collection, the collection
can be passed as far down a function call chain as necessary without further
worry, and always used with a simple for each iterator.

A paramarray cannot be passed down a function call chain expecting a
paramarray (without work in the receiving function).  Neither your solution
or mine "just works", both require interior code to perform a conversion at
some level.  The method I use requires the conversion once, at the top
level.  Passing a param array requires that conversion at each level of the
chain.  

What I was trying to discover with the thread was whether there is "syntax"
built into VBA that allows me to pass a paramarray to a paramarray and use
the passed in array directly and without further decomposition.  There is
not.

Personally if I have to perform a conversion, I prefer to convert to a
collection and pass that.  The conversion to a collection is trivial and
readable.

John W. Colby
Colby Consulting
www.ColbyConsulting.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.


-- 
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