I need to disable all controls except one checkbox on my form (and subforms) depending on the condition of another checkbox. I have tried looping through the controls collection as follows:
dim ctl as control
For Each ctl in Me.Controls
Me.Ctl.Enabled = False
Next ctl
Then I planned to re-enable the checkbox I need as follows:
Me.CkNeeded.Enabled = True (Which works)
But of course Access does not allow me to refer to the "enabled" property when using a variable as the control name. I have tried some different syntax to no avail.
Any help will be much appreciated! Thanks in advance!
Mike
dim ctl as control
For Each ctl in Me.Controls
Me.Ctl.Enabled = False
Next ctl
Then I planned to re-enable the checkbox I need as follows:
Me.CkNeeded.Enabled = True (Which works)
But of course Access does not allow me to refer to the "enabled" property when using a variable as the control name. I have tried some different syntax to no avail.
Any help will be much appreciated! Thanks in advance!
Mike