BTW, a simpler way to do this would be to make this a callable routine:
Public Sub SwitchControls(pFrm as Form, pblnEnable as boolean)
Dim ctl as Control
For each ctl in pFrm.Controls
If TypeOf ctl is Form then
Call SwitchControls(ctl, pblnEnable)
ElseIf TypeOf ctl is TextBox or TypeOf ctl is ComboBox
.Locked = not pblnEnable
.Visible = pblnEnable
Msgbox "I forgot to handle this type of control!"
To enable controls, in your form make this call from code in your form:
To disable controls:
NOTE: Doing this will automatically handled nested SubForms to any depth allowed by Access.
Randall J Weers
Membership Vice President
Pacific NorthWest Access Developers Group