A variation of this method:
If you only want to Disable some Controls on a Form, or even some Controls of a certain type , but not all Controls:
In Form Design View
- Press and Continue Holding down the <Shift> key
- Select all Controls you want to Enable/Disable
- Release the <Shift> key
- Right-Click to open Menu
- Click on Properties - Other
- In the Tag Property Box enter the word Target (no Quotation Marks!!!)
Now, in code, to Disable only the 'tagged' Controls
Code:
Dim ctl As Control
For Each ctl In Me.Controls
If ctl.Tag = "Target" Then
ctl.Enabled = False
End If
Next ctl
And to reverse this, of course, you just change
ctl.Enabled = False
to
ctl.Enabled = True
Linq ;0)>
The problem with making anything foolproof...is that fools are so darn ingenious!
All posts/responses based on Access 2003/2007