hello every body
i have a question, I need to lock one ligne in a tabel, is it possible for Access 2010 ?
thank's for your response
21 2932 jimatqsi 1,271
Recognized Expert Top Contributor
Taken,
Welcome to Bytes. You'll find a large number of eager helpers here, but you'll have to do your part to present a good explanation of what you want. Please expand on what you said, because it is not very clear what purpose you are trying to accomplish.
Is this a permanent "lock" or during some brief period? If so, what is that period defined by?
Jim
thank's jimatqsi
I work for an application Access VBA 2010 the application have back end and front end, 5 users the problème is:
I have two tables original and Bis, the Original table contains one line Identity and the Questions and there Responses.
the tabel Bis Contains a temporary line (they will be delete after click on bouton) the questions and Responses, to permit for a users to edit data and write Responses.
I want When I click on button to save edit, the line identity from tabel Original will be locked
thank U fore your help
Rabbit 12,516
Recognized Expert Moderator MVP
Why have a temp table where they edit the record separately from the original?
hello Robbit thanks for your response
the temp table is local for each user, it permit to not get the dirty data in the original table. all records will be delete from the temp table for each edit
By This Section
You need to make another form, that is lock
and only few row or field can be for General Users
Like
User Id _______
Search by Name _______
Date
Thank you Asmat for your response
I want just to know how can I lock one record from table on vba access.
I tries
Set rstQR = New ADODB.Recordset
Set conn = New ADODB.Connection
Set conn = CurrentProject.Connection
rstQR.Open "SELECT tableName.ID, tableName.NbrQuestion FROM tableName " _
& "WHERE (((ID)=" & Me.ID & ") AND " _
& "((NbrQuestion)=" & Me.NbrQuestion & "))", conn, adOpenUnspecified, adLockPessimistic, adCmdText
it work but dont lock the record showed on SQL statment
jforbes 1,107
Recognized Expert Top Contributor
You can't lock a record for edit in Access except for a temporary lock while a SQL process is taking place. Once the SQL process is completed, the lock is released. It's not intended to last more that a second or two.
Usually, in the scenario you are describing, a flag or status field is added to the Table to put a "Soft Lock" on the Record. Then code is added to the Forms to either set and reset the Allow Edits and Allow Deletions properties of the Form or enable or disable buttons that launch the Editable Forms.
Yes jforbes that's what I need ! à temporary lock but juste for one record from tabel (back end) not from form (front end).
but I don't know if it's possible ??
if it is possible I don't have any Idea for how can I do it.
I know how to lock tabel but not just a record from that table
best regard
Rabbit 12,516
Recognized Expert Moderator MVP
You can't "hard" lock a table or row in Access. You will have to use a more robust database backend if you want to do that.
You can only code your own "soft" lock that the user can get around by opening the table directly.
Thank's Robbit
My problem is How to specifate one record from table to lock it ?
I want to lock juste the record specified not all the table
Rabbit 12,516
Recognized Expert Moderator MVP
Add a field to the table that says whether or it it's locked. You set it when you want to lock or unlock it.
Thank U Rabbit for your response. sorry for my absence.
I want to know what kind of Number permit me to lock one record
in set recordset=currentdb.openrecordset("Select...", Type, Option, Lockedit)
Exemple: 2, 512,2)
best regard
Hello every body
I get the solution
(2, 2, 3)
but the problem is that the first user is blocked :'(
I want to lock for the second user
Rabbit 12,516
Recognized Expert Moderator MVP
The recordset options will block everyone except the recordset.
my probem is when I test with two form, with loop an doevents for each user, on click on button, the edit of the first user (first click on button) will not be saved. the edit of the second user will be saved
Rabbit 12,516
Recognized Expert Moderator MVP
That's it Robbit thank U so mutch,
Rabbit 12,516
Recognized Expert Moderator MVP
No problem, but you should be aware that the lock lasts only as long as the object. It won't keep the lock if the user wants to come back to the record later to finish up.
Another Problem
2, 1, 2 lock all the table, my aime was to lock one record
2, 2, 3 lock one record but if two users clic for the same record
the edit of the first user will be ignorent
Rabbit 12,516
Recognized Expert Moderator MVP
At this point, I don't know which combination is going to work, you could try all the possible combinations until you find the one that does.
Ok thank you Rabbit, when I find the solution I'll post it
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Tom Cusick |
last post by:
We have a Job Shop database. When I get an order in I put all the
line item information into the database. Some orders have multiple
lines and most of the information is the same. (eg. Customer...
|
by: ethanj /personal/ |
last post by:
I have main form with subform, similar to the Order Details form in
the Northwind database.
The the main form record locking is released when I click to edit
subform's records. Is there away to...
|
by: Themis Parintas ste kardias |
last post by:
How can i make a form which is lock and display only the 3th record of a
table
|
by: deko |
last post by:
I'm trying to import an Excel Spreadsheet into an Access Table but sometimes
things get buttered up if the spreadsheet does not have the right columns.
So I want to drop the Access table and...
|
by: carrionk |
last post by:
Hi,
I need to compare if certain records are contained whithin a Master
Table.
The following tables illustrates the comparing tables and the required
Result
Master Table
============...
| |
by: equalive |
last post by:
Hi guys,
I'm having problem locking a table in Ms Access using VB6 code.
Actually I have 3 tables.
Assume table names is A, B, C.
Following is the process.
1. Open table A and update table...
|
by: adri4n |
last post by:
as wat ive mentioned in the title.. im would like to know whether the a
particular record/table is being locked in my program. some of the
methods which i would like to develop are as below:
...
|
by: nytimescnn |
last post by:
I've read some discuession about lock() for thread-safe. I am wondering
what will be the differce between below two code segment?
Code 1:
class A
{
private static Object padlock = new...
|
by: HDI |
last post by:
Hi,
I'm writing a windows application where users can update records but
how can I lock a record when a user opens it.
With ado and vb6 you can lock the opened record but with ado.net I...
|
by: stuart |
last post by:
I have a list of records in a subform that a user can either edit or
delete. This is an unbound form. If the user deletes a record, I
want to refresh the form, and then position the cursor on the...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
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: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |