Followed your example, but got an error for the code
"=LockBoundControls([Form],True)"
when I wrote it in the code at Private Sub Form_Load(). It says after
translation to English something like: "Compiling error: Expected: a
row
number or a row label or a program statement or end of program statement."
Maybe I have tried to put it in the wrong place, but I could not find
an
On
Load property for the form. Should it be somewhere else?
/ Rolf
"Allen Browne" <
[email protected]> skrev i meddelandet
If you set the form's AllowEdits property to Yes, you will not be able to
use any controls for editing, regardless of their Locked property.
You need to leave AllowEdits as No, and set the Locked property to No for
all the control other than the one the one you allow. Of course they have
be
be set back to Yes for new records.
Use the code in this link:
Locking bound controls on a form and subforms
at:
http://allenbrowne.com/ser-56.html
The article explains how to call the code from a command button, but
in
your
case you will want to call it from the Current event of the form, like
this:
Call LockBoundControls(Me, Not Me.NewRecord,
"NameOfControlToNotLock")
I have a form that is locked for editing already by opening the form. In
the
code I use the line "Me.AllowEdits = Me.NewRecord" so that only new
records
can be written.
Now I need to let the user be able to change one single field also
on
old
records. How can I let him do that? I have tried "Field.Locked = False"
and
"Field.Enabled = True" but it does not help.