Setting control captions using an array??

  • Thread starter Thread starter Art
  • Start date Start date
A

Art

I would like to set a series of label captions based on
an array. For example if I have label controls on a form
named lbl1, lbl2, lbl3, etc. I would like to set the
caption based on values in an array.
for i to max
me!lblx.caption = stringarray(i)
next i
I do not know how to setup a string that would refer to
the appropriate control.
eg. lblx = "lbl" & format$(i, "0")
me!lblx.caption
Is this possible?
TIA
Art
 
Hi,
Try this:
for i =0 to max
me("lbl" & i).caption = stringarray(i)
next i

Of course your labels would have to start at lbl0
 
Back
Top