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

How to lock entry

I have a database with few connected tables, and I have a true/false
checkbox in one table.
Is it possible to lock that row when checkbox iz turned on "true" so the
data only in that row cannot be edited?

Thanks
Jun 21 '06 #1
2 1578
If you use a form, you can prevent the records from being edited if the
IsLocked field is Yes, by putting code like this into the Current event
procedure of your form:

Private Sub Form_Current()
Dim bLock as Boolean
bLock = Nz(Me.IsLocked, False)
If Me.AllowEdits = bLock Then
Me.AllowEdits = Not bLock
End If
End Sub

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Kreso" <vi******@gmail.com> wrote in message
news:e7**********@ss408.t-com.hr...
I have a database with few connected tables, and I have a true/false
checkbox in one table.
Is it possible to lock that row when checkbox iz turned on "true" so the
data only in that row cannot be edited?

Thanks

Jun 21 '06 #2
Thank you very much, it works!

"Allen Browne" <Al*********@SeeSig.Invalid> wrote in message
news:44***********************@per-qv1-newsreader-01.iinet.net.au...
If you use a form, you can prevent the records from being edited if the
IsLocked field is Yes, by putting code like this into the Current event
procedure of your form:

Private Sub Form_Current()
Dim bLock as Boolean
bLock = Nz(Me.IsLocked, False)
If Me.AllowEdits = bLock Then
Me.AllowEdits = Not bLock
End If
End Sub

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Kreso" <vi******@gmail.com> wrote in message
news:e7**********@ss408.t-com.hr...
I have a database with few connected tables, and I have a true/false
checkbox in one table.
Is it possible to lock that row when checkbox iz turned on "true" so the
data only in that row cannot be edited?

Thanks


Jun 21 '06 #3

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

Similar topics

1
by: Don Nelson | last post by:
hi, I am using SQL server 2000.and trying to resolve a deadlock issue.For this i am looking at SQL profiler.and while turning the trace on, i select Lock:Timeout event that needs to be traced.When...
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...
3
by: xixi | last post by:
can someone explain to me what is internal p lock, internal s lock, internal v lock? when i have IS lock or IX lock , i always have these internal locks together for the application handle ...
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: Sunny | last post by:
Hi, I can not understend completely the lock statement. Actally what is locked: 1. the part of the code between {...} or 2. the object in lock() In the docs is written: for 1: The lock...
3
by: Invalid | last post by:
I launch a worker thread that periodically reads a volatile bool abortRequested, which could be set to true by my main form. IOW, there is one thread that can read that bool and one different...
5
by: User N | last post by:
I have a log class with static methods that grab and release a mutex as required. The log class is designed to be called from both GUI and thread pool threads, and dump output to a logfile and a...
5
by: Lloyd Dupont | last post by:
in an ASP.NET page I have some static method which get value for the cache or, if the cache is empty, query the database, put the value in the cache and return it. because ASP.NET is thread...
5
by: Chakravarti Mukesh | last post by:
Hi, I want to get an event if someone locks her/his computer so that I could do some finalizations before actually locking the system. For example how can I ensure that an user close a...
2
by: Lidia | last post by:
Anybody has any ideas?
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
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,...

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.