


If you do not want your subform locked, name it in the exception list. Nested subforms are therefore handled to any depth. If it finds a subform, the function calls itself recursively. (You can specify controls you do not want unlocked.) is bound to an expression ( Control Source starts with "=").has no Control Source property (buttons in an option group).Next it loops through all controls on the form, setting the Locked property of each one unless the control: This solution locks only the bound controls on a form and handles its subforms as well.įirst, the code saves any edits in progress, so the user is not stuck with a half-edited form. Setting a form's AllowEdits property prevents that, but also locks any unbound controls you want to use for filtering or navigation. It is very easy to overwrite data accidentally in Access.

Provided by Allen Browne, September 2005. Microsoft Access tips: Locking bound controls on a form Microsoft Access Tips for Serious Users
