Locking all option buttons on a form

C

Chris

Is there a way to lock all the option buttons on a form
with out typing out them individually?

What about text boxes?

Thanks for your help,

-Chris
 
J

John Spencer (MVP)

You can do this with a bit of vba code. AIRCODE follows.

Dim ctlAny as Control

For Each ctlAny in Me.Controls

IF ctlAny.Type = acOptionButton Then
ctlany.locked = true
ctlany.enabled = false
End if

Next CtlAny
 

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