J
John Baker
I would like to disable controls on a subform but am having problems
with the following code.
For Each ctlC In Forms!frmOrder!SubformfrmOrderDetails.Controls
If ctlC.ControlType = acTextBox Or ctlC.ControlType =
acComboBox Then
ctlC.Enabled = False
ctlC.Locked = True
End If
Next ctlC
The problem is that the code falls over as it will not disable a control
which has the focus. I have tried different ways to refocus the control to
the main form but can't seem to get it to work.
Any help greatly appreciated.
John Baker
with the following code.
For Each ctlC In Forms!frmOrder!SubformfrmOrderDetails.Controls
If ctlC.ControlType = acTextBox Or ctlC.ControlType =
acComboBox Then
ctlC.Enabled = False
ctlC.Locked = True
End If
Next ctlC
The problem is that the code falls over as it will not disable a control
which has the focus. I have tried different ways to refocus the control to
the main form but can't seem to get it to work.
Any help greatly appreciated.
John Baker