Lock a control from a different form

  • Thread starter Thread starter ruchie
  • Start date Start date
R

ruchie

i am trying to lock a control in the form adduser from a different
form. below is what i am trying to use for that:

Forms!adduser!fname.Locked = True

Unfortunately, this isnt working for me. Could anyone let me know
where i am going wrong?
 
ruchie said:
i am trying to lock a control in the form adduser from a different
form. below is what i am trying to use for that:

Forms!adduser!fname.Locked = True

Unfortunately, this isnt working for me. Could anyone let me know
where i am going wrong?


It would be a bit more helpful if you could tell us what error you are
getting. Is the form "adduser" open when you run the code? Is the control
"fname" a data control, such as a text box, combo box, list box, or check
box?

Note that a form being open as a subform on another form is not the same as
being open in its own right, and it can't be referred to the same way.
 
ruchie said:
i am not getting any error message, just that the control isnt locking.


You'd better give some background, then, so we can figure out what's going
on. First, are you sure it isn't locking? Are you clear on the difference
between Locked and Enabled? After you run the locking code, are you able to
change the value of the control? Since you're not getting any error
message, is it possible that you have error handling disabled with "On Error
Resume Next"?
 
Back
Top