View Single Post
  #3  
Old February 11th, 2010, 09:56 PM posted to microsoft.public.access.forms
Rlong via AccessMonster.com
external usenet poster
 
Posts: 7
Default Lock/unlock form button

Thanks, Allen! This code works as well, and it's helpful to be able to unlock
individual controls. I do, however, like the way the other code "relocks" the
form after editing any single field, so you don't accidently leave the form
unlocked. I'm wondering if there's a way, using the original code that I
posted, to include a line or two that would leave individual controls
unlocked? Any ideas? I'm a fairly low-level code writer, so I'll need to rely
on others for this one.

Thanks again.



Allen Browne wrote:
Take a look at this article:
Locking bound controls on a form and subforms
at:
http://allenbrowne.com/ser-56.html

You copy the code from the webpage into a standard module, and set your
form's On Load property to:
=LockBoundControls([Form],True)
You can optionally add the name of any controls that should not be locked
inside the brackets as well, in quotes and separated by commas. So, if you
want Combo1 to remain unlocked at all times, use:
=LockBoundControls([Form],True, "Combo1")

The code automatically locks any subforms you have on your form (nested to
any depth.)

I've successfully created a button that locks/unlocks all the fields in a
form. In addition, it keeps all fields unlocked during initial record

[quoted text clipped - 64 lines]
End Select
End Sub


--
Message posted via http://www.accessmonster.com