Hmmm...a workaround, but not with Enabled, but with Locked:
The checkbox must be bound to a field in the recordset.
Use the Current event to lock/unlock all controls except the checkbox. Same code should run in the AfterUpdate event of the checkbox:
Private Sub LockUnlock()
Dim ctr As Control
On Error Resume Next
For Each ctr in Me.Section(0).Controls
If ctr.Name <> "CheckBoxName" Then ctr.Locked = Me("CheckboxName")
Next
End Sub
Private Sub Form_Current()
LockUnlock
End Sub
Private Sub CheckBoxName_AfterUpdate()
LockUnlock
End Sub
The truth is that the controls in all records will be locked/unlocked, but since you can only have ONE active record, the goal is achieved...
Place a small textbox in the detail section:
=[CheckBoxName]
Make sure the font color is the same with the back color.
For this textbox, use Conditional formatting to set the back color AND fore color to red if the checkbox is true.
This will be an indication of the records that are locked or unlocked.
Conditional formatting is not available in Access 97 or earlier.
HTH
![[pipe] [pipe] [pipe]](/data/assets/smilies/pipe.gif)
Daniel Vlas
Systems Consultant