473,385 Members | 1,958 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

how to lock a box in a form?

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
3 981
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
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
csenasa
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

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

Similar topics

2
by: Roy Padgett | last post by:
I have a combo box where users select the customer name and can either go to the customer's info or open a list of the customer's orders. The RowSource for the combo box was a simple pass-through...
1
by: Jinlin | last post by:
I found a interesting problem in C# and couldn't explain it. The code to reproduce it is very simple: 1. Create a windows application in C#. 2. Listen to the activated event on the default form...
7
by: John Bailo | last post by:
I'm seeing some odd locking behavior when using an DB2400 database and running an ado.net transaction. My code -- in simplified form, appears at the bottom. I want to run several INSERT...
18
by: Robert | last post by:
Hi! I was wondering if the was any way to determine the state of the caps lock key, on or off. Of course I can capture the key events and see whether the caps lock is pressed, but that does not...
0
by: John Bailo | last post by:
I'm seeing some odd locking behavior when using an DB2400 database and running an ado.net transaction. My code -- in simplified form, appears at the bottom. I want to run several INSERT...
7
by: Saintor | last post by:
What I do now is I put a value in the tag property, and using the form_current event, I run through all controls properties until the ones with the required tag value are met. Sound OK in theory,...
5
by: Zürcher See | last post by:
I have a main form, which pop other forms (children forms). The children forms have a delegate of a function, let call it EndFunction, of the main form, that they call when they ends their work....
5
by: pgdown | last post by:
Hi, I have several processes accessing files from one folder, but only one process should ever access each file. Once one process has the file, no other process should be allowed to access it,...
1
by: chintuna4it | last post by:
How to implement a vb.net windows based Application lock like windows lock Lock means suppose we hv a option like lock in our form and press lock so our application is lock and then press enter then...
25
by: zmickle | last post by:
Excuse my noobness. I am managing an access database that is shared by 4 users. Management does not want to use any technologies outside of access for this application (no SQL Server, etc). I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.