[2005] [Resolved] Redim ??
Hi All,
I have defined a public constant called iNoDepartments and set it to 13. I use this constant throughout my app in setting arrays and for loops. My question is I want to change it so that the number can be variable. Basically I want to check the Departments table at the start of my app to see how many records there are and then set my constant to that number thus setting my arrays / for loops correctly. Does anyone know if this is possible and how?
Thank you all for any advice,
Jiggy!
Re: [2005] [Resolved] Redim ??
We have deep confusion here! I need to use an array, that was the whole point of this post. I need to store a list of information but the array I want to store it in depends on the number of records I am getting the info from so I will only know in runtime not design time.
Re: [2005] [Resolved] Redim ??
You said that you create an array with one element, then you use ReDim later to create another array. What's the first array with one element for? You don't need it so don't create it. Simply declare the variable and don't create the array until you need it.
VB Code:
'Declare the variable but do not create the array.
Private myArray As Object()
VB Code:
'Create an array with elementCount elements.
Me.myArray = New Object(elementCount) {}