This code goes a bit further as it gives you a command button which
you can lock and unlock a form. Nevertheless it will give you a good
start and you can strip out what you don't need.
In some situations you may want to lock the fields on a form unless
the user explicitly choose to update the transactions. While you
could set the forms Allow Edits property to false this doesn't work
for subforms. Other wierdnesses happen but I can't recall exactly
what right at the moment. This solution shows how a call to a public
subroutine passing a few parameters handles this situation.
http://www.granite.ab.ca/access/locking_fields_on_a_form.htm
Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog -
http://msmvps.com/blogs/access/