Solved loop all controls (1 Viewer)

cheekybuddha

AWF VIP
Local time
Today, 22:00
Joined
Jul 21, 2014
Messages
2,237
OK, so there's the problem - your labels are not named consistently.

You have:
Etykieta239
Etykieta_150

The LabelClick() function expects an Integer, but when you create the OnClick handler for Etykieta_150 it looks like:
=LabelClick(_150)

This is invalid syntax.

So, you must change all labels to use the same format.
Either 1:
Etykieta239
Etykieta150
Or 2:
Etykieta_239
Etykieta_150

If you choose 2, then you must change the Const value:
Private Const LABEL_PREFIX As String = "Etykieta_"

hth,

d
 

romanlo

Member
Local time
Today, 23:00
Joined
Feb 24, 2020
Messages
38
OK, so there's the problem - your labels are not named consistently.

You have:
Etykieta239
Etykieta_150

The LabelClick() function expects an Integer, but when you create the OnClick handler for Etykieta_150 it looks like:
=LabelClick(_150)

This is invalid syntax.

So, you must change all labels to use the same format.
Either 1:
Etykieta239
Etykieta150
Or 2:
Etykieta_239
Etykieta_150

If you choose 2, then you must change the Const value:
Private Const LABEL_PREFIX As String = "Etykieta_"

hth,

d
Dear cheekybudha. Now it is working perfectly as wished. Thanks a lot for your time. I am very green in this yet.
 

cheekybuddha

AWF VIP
Local time
Today, 22:00
Joined
Jul 21, 2014
Messages
2,237
You're welcome! (y)
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 17:00
Joined
Feb 28, 2001
Messages
27,001
@romanio

Just as an amplification... when you are playing around with dynamic name searching and manipulating, this is a case where consistency really is very important. Mostly for the predictability it offers.
 

cheekybuddha

AWF VIP
Local time
Today, 22:00
Joined
Jul 21, 2014
Messages
2,237
>> this is a case where consistency really is very important <<

So true! Computers are a lot more precise than humans!
 

Users who are viewing this thread

Top Bottom