Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change name of control at runtime.

Status
Not open for further replies.

Disferente

Programmer
Jun 23, 2008
112
US
Is there any way of changing the name of a control at runtime?
If not, is there any good way to refer to a control by use of a property that you can change, like
Me.Controls("NameOfControl")
 




...and the reason is...

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
I have a multi dimensional array of controls where one is named like Control_01_000_001 and the one of the same type after that would be named Control_01_000_002.
I would like to remove the first control and just change the reference to the control in the array.
As I have it now that works fine, as long as I don't create any new controls after removing one in the middle, because creating a new one then would use a name that is already used.
 
There is a way I can get around this, but that involves moving all the data from one set of controls to another, and that takes much more time and much more coding then just shifting the references to them.
 
I came up with another way of doing it, I use a common number that increases by one for all the controls and I put the identifying string in the tag property instead.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top