Can someone help me fix this...
I'm just trying to create an Option Button that will Lock/Unlock a SubForm upon change. I've seen and read many other threads on this topic but still cannot get it to work. Other threads recommended adding/changing the tag on all the forms controls. I thought it would make more sense to simply edit the tag of the control making the changes. Here's what I have so far:
Also, I know I will have to paste basically the same code in my FormOpen code but I kept having problems with that... ".Locked" wasn't a viable property of a control apparently.
Thanks.
I'm just trying to create an Option Button that will Lock/Unlock a SubForm upon change. I've seen and read many other threads on this topic but still cannot get it to work. Other threads recommended adding/changing the tag on all the forms controls. I thought it would make more sense to simply edit the tag of the control making the changes. Here's what I have so far:
Code:
Private Sub ButtonLockForm_Click()
If Me.ButtonLockForm.Tag = "Locked" Then
For Each Control In Forms!Neighborhoods.HOA_Associations_subform.Form.Controls
If Control.Name = "ButtonLockForm" Then
Control.Locked = False
Else
Control.Locked = False
End If
Next Control
Me.ButtonLockForm.Tag = "Unlocked"
Else
For Each Control In Forms!Neighborhoods.HOA_Associations_subform.Form.Controls
If Control.Name = "ButtonLockForm" Then
Control.Locked = False
Else
Control.Locked = True
End If
Next Control
Me.ButtonLockForm.Tag = "Locked"
End If
End Sub
Also, I know I will have to paste basically the same code in my FormOpen code but I kept having problems with that... ".Locked" wasn't a viable property of a control apparently.
Thanks.