N
NZ VBA Developer
In an earlier post, Jean-Guy Marcil provided me with some excellent
instruction on structuring projects to separate UserForm-related processes
from document-related processes. (Thanks again, Jean-Guy!) I'm now trying to
apply this structure to a somewhat more complex project and have run into a
problem straight away.
In this new project, I use arrays to collect sets of similar information
(e.g. the names and addresses of multiple parties to a contract). These
arrays all reside in the UserForm class module, since they are obviously
integral to the processes related to the UserForm; i.e. UserForm operations
are used to create and maintain the arrays, and the arrays are used to
display information in the UserForm.
However, I cannot find a way to take the information in these arrays and
transfer it back into the 'operational' class module that is used to perform
the actual document-creation processes. UserForm controls (and the values
contained therein) are simple enough to access and variables can be declared
as Public and then just become a 'pseudo-attribute' of the UserForm object,
but arrays cannot be Public.
For obvious reasons, I don't want to dynamically create a heap of Public
variables to dump the contents of the arrays into and then rebuild the arrays
on the 'operational' side, and doing something like grabbing the contents of
the ListBoxes that are used to display and maintain the arrays on the
UserForm and then attempting to parse this information scares the daylights
out of me. Does anybody have any suggestions on how to share contents of an
array between two modules?
--
Cheers!
The Kiwi Koder
Please note: Uninvited email contact will be marked as SPAM and ignored -
unless you want to hire me. ;-)
instruction on structuring projects to separate UserForm-related processes
from document-related processes. (Thanks again, Jean-Guy!) I'm now trying to
apply this structure to a somewhat more complex project and have run into a
problem straight away.
In this new project, I use arrays to collect sets of similar information
(e.g. the names and addresses of multiple parties to a contract). These
arrays all reside in the UserForm class module, since they are obviously
integral to the processes related to the UserForm; i.e. UserForm operations
are used to create and maintain the arrays, and the arrays are used to
display information in the UserForm.
However, I cannot find a way to take the information in these arrays and
transfer it back into the 'operational' class module that is used to perform
the actual document-creation processes. UserForm controls (and the values
contained therein) are simple enough to access and variables can be declared
as Public and then just become a 'pseudo-attribute' of the UserForm object,
but arrays cannot be Public.
For obvious reasons, I don't want to dynamically create a heap of Public
variables to dump the contents of the arrays into and then rebuild the arrays
on the 'operational' side, and doing something like grabbing the contents of
the ListBoxes that are used to display and maintain the arrays on the
UserForm and then attempting to parse this information scares the daylights
out of me. Does anybody have any suggestions on how to share contents of an
array between two modules?
--
Cheers!
The Kiwi Koder
Please note: Uninvited email contact will be marked as SPAM and ignored -
unless you want to hire me. ;-)