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

Locking Field in MS Access

jen
Hello,

I'm trying to lock two fields on a form, but only for data
editing/deletion. I want the user to be able to enter data, but once
it's saved, it needs to be locked. Any help would be greatly
appreciated!

Jen

Nov 13 '05 #1
3 1531
Try the OnCurrent event of the form something like

If Nz(Field1) = 0 then
Field1.Locked = True
Else
Field1.Locked = False
End If

HTH

Phil
"jen" <je*******@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Hello,

I'm trying to lock two fields on a form, but only for data
editing/deletion. I want the user to be able to enter data, but once
it's saved, it needs to be locked. Any help would be greatly
appreciated!

Jen

Nov 13 '05 #2
I recommend doing the following. This way it is easy to later add
fields you wish to lock.
And leaves you ability to change invalid data later if necessary

Create a new field in your table called
"Lock_Lookup"
set it as a Yes/No Data Type.

That field will work as a lock lookup. If it is checked the Field you
wish will lock using the following:
In the form use a button that goes to the next record or a new
CommandButton to set the lock lookup to "checked"
As seen below

Forms!testform!lock_lookup = "-1"

or you could put the "lock_lookup" field as a checkbox into your form.

Once it is checked in a record the selected field will be locked. The
advantage of this is if needed it is easily accesable to unlock.

Then

In the Form Set an On Current Command equal to

If Forms!testform!lock_lookup = "-1" Then
Forms!testform!field1.Locked = True
Forms!testform!field2.Locked = True
End If

This would create a process that would lock any amount of records at a
push of a button or click in a checkbox

Nov 13 '05 #3
jen
Thanks for the Help!

Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: Nid | last post by:
How do I do row-level locking on SQL Server? Thanks, Nid
2
by: spammy | last post by:
hi all, im trying to establish whether i have a race condition or critical section in the following. i have a dataaccess class that continually retireves a table from a sqlserver (which may be...
1
by: Justin | last post by:
Hello: I have a question regarding Record Locking in ASP...If the user x's out of the web page, how can I unlock the record? A co-worker told me it has to be done in Javascript, but he doesn't...
2
by: Shaun | last post by:
Ok here is the situation… Have an access 20002 application that I'm converting to have a SQL Server backend (2000), the application has been in use with an access backend for years, no real...
6
by: MS | last post by:
Access 97 here. I want a simple way to "lock" certain records on a form. Some records remain "live" until all data is available which happens over time. When all the fields are complete, I want...
0
by: xpding | last post by:
Hello, I have a class MyEmbededList contains a generic dictionary, the value field is actually the MyEmbededList type as well. There is another class need to access and manipulate a list of...
1
by: tazdiver | last post by:
Hi All, I am having an issue with an windows application made from VB.NET 2003 which is using an access database. Basically the problem is that when the user updates a field on the app from a...
0
by: Cindy Huyser | last post by:
I have an Access 2000 database behind a threaded Java application that that can have have concurrent access to the same table (but not the same record). The database is set up for shared access...
3
by: David C. Barber | last post by:
How do you lock a record in SQL Server from ASP 2? I need to read the record, allow the user to edit it, and then have them click Save and rewrite it. Obviously I don't want anyone else getting...
0
by: Andy_Khosravi | last post by:
I'm having issues with updates being blocked due to some sort of record locking issue. The error does not occur consistently, so I've had a hard time nailing it down. It does happen enough to cause...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.