By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,949 Members | 884 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,949 IT Pros & Developers. It's quick & easy.

how to lock a box in a form?

P: 5
Hi all,

I have an user_form in excel that lets the users input and modify data, which will be stored in an access database. There's one box in this form that I would let the users enter data in, but I would like to lock this box so that it can not be modified when the form is reopened.

Does anyone know the VB codes to lock a box on a user_form? or how else can I approach this issue? any suggestion is greatly appreciated.

Thanks in advance for your help.
Sep 17 '07 #1
Share this Question
Share on Google+
3 Replies


P: 88
Hi all,

I have an user_form in excel that lets the users input and modify data, which will be stored in an access database. There's one box in this form that I would let the users enter data in, but I would like to lock this box so that it can not be modified when the form is reopened.

Does anyone know the VB codes to lock a box on a user_form? or how else can I approach this issue? any suggestion is greatly appreciated.

Thanks in advance for your help.
I think what you're looking for is the Enabled property. When the form is reopened, simply set txtTextBox.Enabled = False, and the user will not be able to change its contents.

If you want to hide it as well as making it unchangeable, use txtTextBox.Visible instead.
Sep 17 '07 #2

P: 5
I think what you're looking for is the Enabled property. When the form is reopened, simply set txtTextBox.Enabled = False, and the user will not be able to change its contents.

If you want to hide it as well as making it unchangeable, use txtTextBox.Visible instead.
Thanks very much. txtTextBox.Enabled works perfectly. appreciate it. ^_^
Sep 17 '07 #3

P: 10
Thanks very much. txtTextBox.Enabled works perfectly. appreciate it. ^_^

try this out,

txtTextBox.locked = true
this also does the same job.

.enabled works fine, but try this and check, does it make any difference..

happy learning..
:-)
Sep 17 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.