txtbox property

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?
 
R

Roger Carlson

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
 
D

Dirk Goldgar

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top