ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   determining array with no bounds set? (https://www.excelbanter.com/excel-programming/391890-determining-array-no-bounds-set.html)

Mark

determining array with no bounds set?
 
I have a form that I use to collect parameters for a query table. All of the
queries have at least 4 parameters, but some that I'm starting to work on may
have more.

One report's code stream may run several queries, some of which will need
the additional parameters, and some of which will not.

So, I need the userform that comes up to collect all of the input
parameters, and then some of the queries to only use the first 4, and some to
use more. A start and end date that would apply to three of six queries, is
what I need to work on right now.

I've been thinking of using an array to tell the form how many additional
input boxes to put up, and their labels. For instance:

arParamList(0,0) = "Start Date:"
arParamList(0,1) = "text"
arParamList(1,0) = "End Date:"
arParamList(1,1) = "text"

could be used to put up two text boxes. The array would have been
dimensioned and defined, before the time when the form is shown.

If there are NO additional input boxes to be put up (no queries in that
report require more than the standard four), the arParmList would be empty...

dim arParmList() , but it would never have been redim'd and populated.

Is there a good way to tell if an array is not defined like that? OnError
would do it, but is there another better way?
Is there a way to tell when an array has been di


Mark

determining array with no bounds set?
 
another way to do what that needs is to just use a single Boolean to tell it
whether to bother with the other parameters.

Perhaps I'll persue that.

"mark" wrote:

I have a form that I use to collect parameters for a query table. All of the
queries have at least 4 parameters, but some that I'm starting to work on may
have more.

One report's code stream may run several queries, some of which will need
the additional parameters, and some of which will not.

So, I need the userform that comes up to collect all of the input
parameters, and then some of the queries to only use the first 4, and some to
use more. A start and end date that would apply to three of six queries, is
what I need to work on right now.

I've been thinking of using an array to tell the form how many additional
input boxes to put up, and their labels. For instance:

arParamList(0,0) = "Start Date:"
arParamList(0,1) = "text"
arParamList(1,0) = "End Date:"
arParamList(1,1) = "text"

could be used to put up two text boxes. The array would have been
dimensioned and defined, before the time when the form is shown.

If there are NO additional input boxes to be put up (no queries in that
report require more than the standard four), the arParmList would be empty...

dim arParmList() , but it would never have been redim'd and populated.

Is there a good way to tell if an array is not defined like that? OnError
would do it, but is there another better way?
Is there a way to tell when an array has been di



All times are GMT +1. The time now is 05:36 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com