Lock a control from a different form

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

Dirk Goldgar

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.
 
D

Dirk Goldgar

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

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