disable group of checkboxes if....

  • Thread starter Thread starter JethroUK©
  • Start date Start date
J

JethroUK©

i want to disable a group of checkboxes (read-only) when a date is completed
(condition changes per record & updated every record change - form_current
event)

i dont want to enable/disable each checkbox individually (because of the
frequency) - and i want them still visible in either state

usually i cover such group with a label and switch it's visibilty on/off:

LableCoveringCheckboxes.visible = isnull(mydate)

but in this case i still need to see/read them (tried a transparent label
but this leaves checkboxes enabled as well as visible)

i have tried sitting them all on a frame - but i can't seem to associate
existing boxes with it - unlike VB, Access frames seems to have specific
purpose

Any Ideas for a simple switch?
 
JethroUK© said:
i want to disable a group of checkboxes (read-only) when a date is completed
(condition changes per record & updated every record change - form_current
event)

i dont want to enable/disable each checkbox individually (because of the
frequency) - and i want them still visible in either state

usually i cover such group with a label and switch it's visibilty on/off:

LableCoveringCheckboxes.visible = isnull(mydate)

but in this case i still need to see/read them (tried a transparent label
but this leaves checkboxes enabled as well as visible)

i have tried sitting them all on a frame - but i can't seem to associate
existing boxes with it - unlike VB, Access frames seems to have specific
purpose


There is no control grouping in VBA, so, unless the options
are in an option group (only one can be selected), you do
need to enable/disable each one separately. This is rarely
a performance problem so the issue is commonly how to do it
in a loop.

Set each control's Tag property to something indicative such
as MYGROUP. Then a procedure like this can be used:

Dim ctl As Control
For Each ctl In Me.Section(0).Controls 'detail section
If ctl.Tag = "MYGROUP" Then ctl.Enabled = IsNull(mydate)
Next ctl
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top