Hi,
I've written a sub (below) to disable controls on forms in my db.
It disables the controls in a form fine using -
sDisableControls Me, True
...but i would like to disable the controls on a subform, by calling it from the form using -
sDisableControls frmFormatRightsSubform.Form, True
It doesn't error but just doesn't do anything.
Anybody any ideas?
Thanks
Tim
Sub sDisableControls(frmForm As Form, blnLockStatus As Boolean)
Dim ctlControl As Control
On Error GoTo ErrorsDisableControls
For Each ctlControl In frmForm.Controls
Select Case ctlControl.ControlType
Case acTextBox
ControlLocked ctlControl, blnLockStatus
Case acListBox
ControlLocked ctlControl, blnLockStatus
Case acComboBox
ControlLocked ctlControl, blnLockStatus
Case acCheckBox
ControlLocked ctlControl, blnLockStatus
Case acCommandButton
ControlEnabled ctlControl, blnLockStatus
End Select
Next ctlControl
ErrorsDisableControls:
Resume Next
End Sub
I've written a sub (below) to disable controls on forms in my db.
It disables the controls in a form fine using -
sDisableControls Me, True
...but i would like to disable the controls on a subform, by calling it from the form using -
sDisableControls frmFormatRightsSubform.Form, True
It doesn't error but just doesn't do anything.
Anybody any ideas?
Thanks
Tim
Sub sDisableControls(frmForm As Form, blnLockStatus As Boolean)
Dim ctlControl As Control
On Error GoTo ErrorsDisableControls
For Each ctlControl In frmForm.Controls
Select Case ctlControl.ControlType
Case acTextBox
ControlLocked ctlControl, blnLockStatus
Case acListBox
ControlLocked ctlControl, blnLockStatus
Case acComboBox
ControlLocked ctlControl, blnLockStatus
Case acCheckBox
ControlLocked ctlControl, blnLockStatus
Case acCommandButton
ControlEnabled ctlControl, blnLockStatus
End Select
Next ctlControl
ErrorsDisableControls:
Resume Next
End Sub