Business Software/Enabled, Locked Properties
Expert: Scottgem - 4/22/2006
QuestionHi Scottgem,
My question is: How do I set up my data entry form in Access so that when I place a "check" in a box, the area's in the relating catagory will "lose focus" and will no longer accept input and the tab will pass over it to the next section. I already have the check box set up with the Yes/No feature. Can I please have step-by-step instructions for this? If you are able to help with this I will be able to contribute in the future to this site. I appreciate the last question you answered in such a timely fashion even though the info you gave me did not help.
Thanks again.
AnswerEvery control on a form has two properties that can prevent it being edited. The Enabled and the Locked properties. When Enabled is set to No, the control is grayed out and will not allow it to receive focus. If Locked is set to Yes, the control can receive focus, but not be changed.
You can set these properties in VBA, using the After Update event of the checkbox. For example:
Me.txtControl.Locked = Me.chkLocked
or
If Me.chkLocked = True Then
Me.txtControl.Enabled = False
Else
Me.txtControl.Enabled = True
End If
I really can't be more specific since it depends on what Property you want to use and how. But this should give you an idea.
HTH
Scott<>