Enablig/Disabling controls

  • Thread starter Thread starter Yair Sageev
  • Start date Start date
Y

Yair Sageev

Greetings again,

I want to enable/disable controls on a contiuous subform detail section
based on whether a checkbox is clicked.

I wrote the following code for the click event of the checkbox:

Private Sub COCB_Click()
Dim cCtrl As CheckBox
Dim cCtrl2 As Control
Dim cCtrl3 As Control

Set cCtrl = Me.COCB
Set cCtrl2 = Me.COExecStatus
Set cCtrl3 = Me.COVisNum


If cCtrl.Value = False Then
cCtrl2.Enabled = False
cCtrl3.Enabled = False
Else
cCtrl2.Enabled = True
cCtrl3.Enabled = True
End If
End Sub

The problem is, it enables/disables EVERY control on EVERY detail section.

What am I doing wrong?


Thanks.
 
The problem is that there is only actually one set of controls on a
continuous forms - it is just repeated several times. So if you chage the
properties of a control it will affect every record.

Instead of using the code have a look a conditional formatting instead.
 
Andrew Smith said:
The problem is that there is only actually one set of controls on a
continuous forms - it is just repeated several times. So if you chage the
properties of a control it will affect every record.

Instead of using the code have a look a conditional formatting instead.

Confirmed, I found the same answer you gave on a number web sites. Access
does indeed cascade controls from detail to detail.

Microsoft should fix this, IMO, because I'm sure there are many people who
want this behavior..
 
Back
Top