Setting control captions using an array??

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
 
D

Dan Artuso

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top