txtbox property

  • Thread starter Thread starter Ayala
  • Start date Start date
A

Ayala

Hi, can I change by code the Locked property of a bound
text box??

How?

I tried:
[Forms]![frmNewEntry].[Form]![Name].Locked = True
Forms!frmNewEntry!Name.Locked = True

with no luck..
any ideas?
 
I don't know. It should be working. It is possible that if the name of
your control is Name, it might be causing Access some confusion. "Name" is
a reserved word. I'd use FullName or something for the control. If the
code is on the form itself, you could also try:

Me!FullName.Locked = True
 
Ayala said:
Hi, can I change by code the Locked property of a bound
text box??

How?

I tried:
[Forms]![frmNewEntry].[Form]![Name].Locked = True
Forms!frmNewEntry!Name.Locked = True

with no luck..
any ideas?

If "Name" is the name of the text box on frmNewEntry, then both of the
statements you posted should work. In what context are you running the
code? I trust the form is open when you run it? Be aware that if you
run the code while the form is open in form view, as opposed to design
view, the change won't "stick". It should, however, work for the time
the form is open. Do you get an error message when you run it?
 
Back
Top