Variable Variables?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I wanted to know if i could have a variable variable in VB for Access

What i mean is i have an array (Jan, Feb, Mar...

Using 2 loops i want to loop thru my original array and for each element in my original array (each month) loop through 35 additional elements. So i mean, for Jan > (Jan1, Jan 2, Jan3) and so on, but those names, {Jan1, Jan 2, Jan 3} are label names for which i want to change the caption

TIA
 
R said:
I wanted to know if i could have a variable variable in VB for Access?

What i mean is i have an array (Jan, Feb, Mar...)

Using 2 loops i want to loop thru my original array and for each element in my original array (each month) loop through 35 additional elements. So i mean, for Jan > (Jan1, Jan 2, Jan3) and so on, but those names, {Jan1, Jan 2, Jan 3} are label names for which i want to change the caption.


You asked about referencing a variable through a constructed
name, but you then say you want to work on label controls,
not variables.

If you want to work on items in a collection, e.g. Controls,
then you can use the name index syntax:

Me.Controls(aryMonths(J) & K).Caption = aryCaptions(J, K)
 
Back
Top