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
 
Top