That worked! Thanks!
I will try to play with changing the background color to see if I can
create the appearance of the field being disabled, but what you gave me
does the most important part, which is to prevent the user from
checking the box.
Ken Sheridan wrote:
> 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
>
> "MariahJ" wrote:
>
> > I want to enable/disable a checkbox on a continuous subform based on
> > the result of another checkbox, but I don't want the checkboxes all of
> > the records to be enabled/disabled. The only way I can think of to do
> > this would be with conditional formatting. Can I programmatically apply
> > conditional formatting to a checkbox?
> >
> > Thanks.
> >
> >
|