Add/change the name of a control...

rede96

Registered User.
Local time
Today, 13:58
Joined
Apr 2, 2004
Messages
134
Just wanted a little help please. I have about 100 option boxes on a form and I want to be able to change the names of the option box and its label. I want to name them from 1 to 100 sequentially. (i.e. option1, option2 ...).

When I create the controls it automatically names them option0, option2 etc. and label3, label5 etc.

I was going to change them via some code but I don’t know how to refer to a control in a form from design view.

Can anyone help please?

Thanks
Red
 
I'm thinking that by the time you do up a little code to do this you could have named them manually...

Just curious, why do have 100 controls on a form? Sounds like you may be in need of a little normailzation...
 
Hi Ken,

Yeah, you're probably right! I've started to change the names manually. I was just curious on how to do it, in case I ever needed to do it again then I'd have the code.

As for why...
Without going into to much detail, the reason for the option boxes is for the user to be able to choose a number of items (these are actually kit or sub-locations in a assembly room) that will that will form a production line.
Usually there will be about 10 options to select per line and the most regular options for each production line will default as selected once the user chooses a line. However as the kit or sub-locations change, the user needs to be able to select the ones he/she wants to include/exclude.

The alternative is a multi-select list box but I didn't want to that. (Don't ask!)

Anyway, I'll keep looking as I would also like to know so that I can create forms dynamically if required. Something I don't know how to do yet.

Cheers
 
You could have created a continuous form with a combo on each line...
 
Cheers Neil,

That is another way that would work fine. I am going to stick to the way I have done it as it is similar with other forms within the application.

I'd still like to know how to change the name of a control though!

Cheers anyway

Red
 

Users who are viewing this thread

Back
Top Bottom