The error suggests you are trying to set the Locked property for a control
that does not have a Locked property (such as a label, or line.)
Here's a more involved version of what Duane is suggesting:
Locking bound controls on a form and subforms
at:
http://allenbrowne.com/ser-56.html
Instead of using the Tag property, the code loops through the controls on
your form, identifying those that have a ControlSource (e.g. text boxes and
combos.) It then looks at the Control Source, and figures out which ones are
bound to a table field (excluding unbound, bound to expressions, or bound to
calculated fields.) It then locks/unlocks those controls.
If it finds a subform, the code calls itself recursively, so as to
lock/unlock any controls in the subform as well, and so on to any depth of
nested subforms.
Implementing it is copy'n'paste stuff. You don't need to modify the code to
suit your form; just set paste in the code, and set a couple of properties.
HTH.