Cycle through some controls and unlock

G

Guest

I have a form that contains contains over 100 controls (divided into tabs).
The locked default is "Yes". Is there some way I can flag certain controls so
that I can cycle through them with an "Edit" button and unlock them? There
are about 50 that will need to be unlocked and I'd rather not have 50 lines
in VB for Me.Controlname.Locked = False if there is another way. Perhaps
check to see if it is a tab stop and if so, unlock it?

I have the code to cycle through ALL controls to lock them. Any help would
be appreciated.

Thanks!
 
G

Guest

You could use the Tag property of each control you want unlocked or locked.
Put a value in it your code will understand and lock or unlock only the
controls with the value.
 
G

Guest

If you do have the code to loop through all the controls you could use the
tag property of the control. Place the word 'check' (or anything you like) in
the control tag and then in your loop check for the control tag by using an
if statement like

if ctl.tag="check" then
do some locking here
end if

that should do the trick with one loop.
 
G

Guest

Thanks to both of you. This worked very well.

Maurice said:
If you do have the code to loop through all the controls you could use the
tag property of the control. Place the word 'check' (or anything you like) in
the control tag and then in your loop check for the control tag by using an
if statement like

if ctl.tag="check" then
do some locking here
end if

that should do the trick with one loop.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top