concatenating labels

elyleeboy

Registered User.
Local time
Today, 00:43
Joined
Sep 9, 2004
Messages
20
Can anybody give me some help:

I have 5 labels (Label1 ,Label2...etc and I want to change their values on the click of a button). But I'm have trouble concatenating. Here is my idea:

For j = 1 To 5
Me."Label" & j.Value = "Drop" & 1
Next j

I know the code is wrong but the idea is there.

Any offers
 
For j = 1 To 5
Forms("frmMainForm")("label" & j).caption = "Drop " & j
Next j


???
kh
 
Hi Ken

I'm Getting this error:

Run-time error '438'
Object doesn't support this property or method.


Any ideas
 
For j = 1 To 3
Forms("frmMain")("label" & j).Caption = "Drop " & j
Next j


This worked on my side. Must be something else wrong...


???
kh
 
Last edited:
PS - You should get rid of the J after next (Next J) as it uses up memory space for a variable uneccessarily.

-Patrick
 
Code:
For j = 1 To 3
    Forms("frmMain").controls("label" & j).Caption = "Drop " & j
Next


Vince
 

Users who are viewing this thread

Back
Top Bottom