473,385 Members | 1,753 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.

Record locking

Hi

Having created and implemented a database, I wish to lock (prevent further
changes) a record when the data entry has been completed, by say having a
'completed' check box on the form that locks that particular record,
although new records can continue to be entered and edited (until
'completed').

How might I go about implementing this?

Cheers
Feb 23 '06 #1
3 1506
bsn

"Mark" <ms*********@btinternet.com> skrev
Having created and implemented a database, I wish to lock (prevent further
changes) a record when the data entry has been completed, by say having a
'completed' check box on the form that locks that particular record,
although new records can continue to be entered and edited (until
'completed').

How might I go about implementing this?

U should use the Form BeforeUpdate(maybe ask a question before saving) or
Form AfterUpdate(check box = -1) event...
Bjarne
Feb 23 '06 #2
Assuming that the completed checkbox is bound, create a function in
your form with the following code

Public Function LockRecord()

If me.chkComplete = True Then
me.AllowEdits = False
me.lblStatus.Caption = "Data entry is complete. Edits are locked."
Else
me.AllowEdits = True
me.lblStatus.Caption = "Whatever"
End If

End Function

In the Forms current event and the after update event of the check box
enter:

=LockRecord

You may want to add some code to confirm before locking the edits.

Jason

Feb 23 '06 #3
Assuming that the completed checkbox is bound, create a function in
your form with the following code

Public Function LockRecord()

If me.chkComplete = True Then
me.AllowEdits = False
me.lblStatus.Caption = "Data entry is complete. Edits are locked."
Else
me.AllowEdits = True
me.lblStatus.Caption = "Whatever"
End If

End Function

In the Forms current event and the after update event of the check box
enter:

=LockRecord

You may want to add some code to confirm before locking the edits.

Jason

Feb 23 '06 #4

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

Similar topics

1
by: Fardude | last post by:
ACCESS 97, Pessimistic Record Locking!??? Does Access 97 allow record level Pessimistic locking? In other words, when user A is editing a record (has it locked) and User B tries to edit it...
0
by: Megan | last post by:
Hi- I have a question about the Microsoft Access Record-Locking Information Icon. Whenever I, or my friends, open my MS Access database, the Microsoft Access Record-Locking Information Icon...
0
by: ethanj /personal/ | last post by:
We are using Access 2000 database, with the following settings. Tool > Options > Advance > Default Record Locking = Edited Record Open databases using record level locking = True Form...
1
by: jv | last post by:
Hello, I'm using A2K and am trying to make sure that my program only locks one record at a time and I don't seem to have any luck getting that to happen. In the database options, I've selected...
1
by: wheel | last post by:
I have been ok with optimistic locking most of the time but I have a situation now where there is more of a chance that users could try to edit a record at the same time. I'd like to use pessimitic...
22
by: RayPower | last post by:
I'm having problem with using DAO recordset to append record into a table and subsequent code to update other tables in a transaction. The MDB is Access 2000 with the latest service pack of JET 4....
9
by: master | last post by:
Actually, it is not only the record locking, what I need, and nobody seems to descibe this. Imagine the following scenario. There is a database with, say 10000 records with some unvalidated...
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...
1
by: Paul H | last post by:
I have an Employees table with the following fields: EmployeeID SupervisorID Fred Bob Bob John Bob Mary Bill Bill I have created a self join in...
19
by: emanning | last post by:
Using Access 2003 and using a form that's mostly bound. I need a way to tell if user-1 is on the record when user-2 tries to open the same record, w/o waiting for the user-1 to save the record...
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: 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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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.