S
Sam Kuo
Hi all,
DanJ's code below was originally used to hide/unhide controls. But I have
tried to modify it to unlock controls and to change fore color instead.
However, it seems the method I used to lock/unlock controls is incorrect. Can
someone please lead me in the right direction?
Private Sub cbEditExistingDrawing_Click()
' Change fore color of all controls with Tag property set to "Hide" to red
(225)
' also unlock them for edit
Dim ctl As Control
For Each ctl In Me.Controls
If ctl.Tag = "Hide" Then
ctl.ForeColor = 225
ctl.Locked = False '<-- Access doesn't support this method
End If
Next ctl
End If
End Sub
After the button is clicked, all controls with tag property equals "Hide"
would be unlocked with its fore color changes to red. My problem is the fore
color changes alright, but the line which was intended to unlock the control
is incorrect, as the Access error message says "Object doesn't support this
property or method".
What would be the correct way to lock/unlock those controls?
Regards,
Sam
DanJ's code below was originally used to hide/unhide controls. But I have
tried to modify it to unlock controls and to change fore color instead.
However, it seems the method I used to lock/unlock controls is incorrect. Can
someone please lead me in the right direction?
Private Sub cbEditExistingDrawing_Click()
' Change fore color of all controls with Tag property set to "Hide" to red
(225)
' also unlock them for edit
Dim ctl As Control
For Each ctl In Me.Controls
If ctl.Tag = "Hide" Then
ctl.ForeColor = 225
ctl.Locked = False '<-- Access doesn't support this method
End If
Next ctl
End If
End Sub
After the button is clicked, all controls with tag property equals "Hide"
would be unlocked with its fore color changes to red. My problem is the fore
color changes alright, but the line which was intended to unlock the control
is incorrect, as the Access error message says "Object doesn't support this
property or method".
What would be the correct way to lock/unlock those controls?
Regards,
Sam