If you set a control's Enabled property to False and its Locked property to
True then the appearance of the control will be unaltered, i.e. not greyed
out, but the user will not be able to edit it, or even move focus to it. So,
say you want a second bound check box to be inaccessible to the user if a
first one is True (checked) the add this function to the subform's (i.e. the
subform's underlying form object's) module:
Function LockControls()
Me.chkField2.Enabled = Not Me.chkField1
Me.chkField2.Locked = Me.chkField1
End Function
and set both the subform's Current event property and chkField1's
AfterUpdate event property to the following in the properties sheet:
= LockControls()
The one slight drawback of this would be that if a user checks the first
check box in one record then moves to a new (or indeed any other record)
record by clicking on the second check box the form's Current event won't
fire until after the click. This would mean that the second check box is
still inaccessible at the time of the first click, so the user would have to
click it again to check it. Focus would in fact be moved to the first
control in the form's tab order in this case as by clicking on the
inaccessible check box the user is actually just moving focus to the record,
not to the check box per se.
Ken Sheridan
Stafford, England