473,394 Members | 1,724 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,394 software developers and data experts.

lock a field after editing

Is it possible to lock a field on a form or sub-form after it has been edited? I want to stop users changing data after it has been entered.

Thanks you
Dec 16 '10 #1
2 1338
Lysander
344 Expert 100+
Yes, easily.

Say the control on the form is called myName and the next field on the form is myAddress

Then in the After_Update event of myName put the following code

myAddress.setfocus
myName.locked=true
myName.enabled=false

(You have to change the focus before you disable the control)

If you are doing this with lots of fields, be careful where you set the focus to, because if you try to setfocus to a control that is disabled it will fall over.
Dec 16 '10 #2
NeoPa
32,556 Expert Mod 16PB
Yes it certainly is.

You will need to think carefully (and post the results of your thoughts too of course) about exactly which circumstances are required to trigger the locking, and very importantly too, exactly when they should be unlocked.

If you can phrase the question fully and clearly we can certainly help further. For now, I will simply draw your attention to the .Locked available for every control.
Dec 16 '10 #3

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

Similar topics

1
by: Mr. M.J. Lush | last post by:
I'm writing a postgres database with a PHP front end for a small work-group , and I want to prevent two editors working on the same record at the same time overwriting each others entry's. The...
1
by: cam | last post by:
Does python support text field editing like the awk command? in awk, we're allow to extract a certain field and output it to another file. however, I've tried search for this in python but to no...
1
by: nospam | last post by:
Amazon wins patent for ordering forms, Collapsing and Maximizing Form Areas.... NAME OF PATENT Method and system for displaying and editing of information # 6,615,226 ...
0
by: Nashat Wanly | last post by:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaskdr/html/askgui06032003.asp Don't Lock Type Objects! Why Lock(typeof(ClassName)) or SyncLock GetType(ClassName) Is Bad Rico...
2
by: Michael Blair | last post by:
I would like to edit an incoming date field which is mm/dd/yyyy and convert it to yyyy-mm-dd as required by mysql. Any ideas?
5
by: tsnyder | last post by:
I need to have an option button that allows editing to a field only when it is checked.
94
by: Samuel R. Neff | last post by:
When is it appropriate to use "volatile" keyword? The docs simply state: " The volatile modifier is usually used for a field that is accessed by multiple threads without using the lock...
7
dlite922
by: dlite922 | last post by:
I need to do some sort of Locking mechanism at interface level, instead of DB Level. I know how MySQL table locking works, but that won't work in my scenerio. Requirements: When someone is...
1
WyvsEyeView
by: WyvsEyeView | last post by:
I have a dataset subform on which I want to lock a field for just two specific records. Each record has a type_id and a desc field. I want to test the value of the type_id field for the current...
1
by: fuadmab | last post by:
How i can i creat a password for one field when i attempt to edit or delete the content of that field in Access 2003 and Windows XP I have a multiuser access programm in a network , or how can i...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.