.Locked method not found

  • Thread starter Thread starter Rohan via AccessMonster.com
  • Start date Start date
R

Rohan via AccessMonster.com

I have a form that I want to lock when the form opens, so in the open event I
set the items to

me.textfield.locked = True
me.combo.locked = True

All of the items have Locked as a property in the properties window, but only
some of them have
it in the vb code. The code gives me a 'no method or property' error.

Can someone help ?

Rohan.
 
Use the form's Load event to change the properties of controls. Many
controls are not yet instantiated in the Open event and your code will error
because the form will not be able to "find" those controls in the Open
event.

As for not having locked property in Intellisense, this may be because you
are not spelling the controls' names correctly, or you have another object
with the same name already, etc.
 
Ok - I moved the code to the load event - same error message.
I'm spelling the controls' names correctly and there are no duplicate objects.

Use the form's Load event to change the properties of controls. Many
controls are not yet instantiated in the Open event and your code will error
because the form will not be able to "find" those controls in the Open
event.

As for not having locked property in Intellisense, this may be because you
are not spelling the controls' names correctly, or you have another object
with the same name already, etc.
I have a form that I want to lock when the form opens, so in the open event
I
[quoted text clipped - 11 lines]
 
Ah - found it - I was using the bound names instead of the actual names of
the controls.
Ok - I moved the code to the load event - same error message.
I'm spelling the controls' names correctly and there are no duplicate objects.
Use the form's Load event to change the properties of controls. Many
controls are not yet instantiated in the Open event and your code will error
[quoted text clipped - 10 lines]
 
Back
Top