Reference label with variable

BigJimSlade

Registered User.
Local time
Today, 18:26
Joined
Oct 11, 2000
Messages
173
Hello, Big Jime here.

Say I have this labels:

lblName1.Caption


I would like to reference it using variable strLabel:

strLabel = "lblName"
strLabel & "1" & ".Caption" = "Big Jim"


I would like to do this without using an array.

Thanks in advance!

Big Jim
 
You would need to use:

Me(strLabel & 1).Caption = "Big Jim"

This is kinda like VB's control array.

So, for a loop have

For i = 0 to 4
Me(strLabel & i).Caption = "Big Jim " & i
next i

and you would reference 5 labels.

HTH
 
pdx! You are the man! (as your name rightly suggests)


Thanks again,

Big Jim
 

Users who are viewing this thread

Back
Top Bottom