473,396 Members | 2,011 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,396 software developers and data experts.

Querying a record's edit lock state

Is there a way to determine whether another record has been pulled up in a form in edit mode PRIOR to allowing that record to be used/opened in the same form? I've described a similar question about record locking, but am still trying to solve and wondered whether there was a way to access the record's attributes/properties that would tell me it's locked for editing before someone else tries to open it.
Jul 26 '07 #1
4 2810
FishVal
2,653 Expert 2GB
Is there a way to determine whether another record has been pulled up in a form in edit mode PRIOR to allowing that record to be used/opened in the same form? I've described a similar question about record locking, but am still trying to solve and wondered whether there was a way to access the record's attributes/properties that would tell me it's locked for editing before someone else tries to open it.
Hi, Nestor.

I think DAO.Recordset.EditMode property is what you are looking for.
Jul 26 '07 #2
Not sure if you are after this but i would try
If CurrentProject.AllForms("Form1").IsLoaded = True Then
MsgBox "Form1 is already in Use"
Else
DoCmd.OpenForm "Form1"
End If
Jul 26 '07 #3
Ok. If I read it right, the checking of the form status will keep others from also opening that form. If this is correct, then I have explained myself wrongly. I do not want to keep others from opening the form (edit record form), but keep them from opening the SAME record in the form used for editing.

As for the other method, will this lock the record set, eg. all the records in the underlying query? How do I target checking the state of a specific record (e.g. customerId #5555 is currently being edited in the "frmCustomerInfoEdit").

I have a continuous form which shows a complete list of customers - "CustList". On that form, there is a button next to each customer that, when clicked, opens another form with full customer details to allow editing/updating.

I want to prevent anyone else from selecting the same customer while someone else currently has the specific customer's record already open. I am trying to generate an error message "record is currently locked" or similar, but preventing that record from being selected.

I have tried setting a value in a field in the record to indicate that it has been locked. However, using "setvalue" only sets the value for a control object and doesn't , on-load,does not immediately write the value to the record table. I have tried using setvalue on a form object and then using requery to get it to write to the table. However, requery is leaving it in a state of "writing" that then prevents other user edits to be written.

I hope I have been clear enough. Let me know if I can provide any othe details.

Thanks a bunch!
Jul 26 '07 #4
Work Around:
if record had a null field [reclocked] then I set open the record in the edit form and onload use a sql update (no warnings) to set the field to 1. when any of the various "done' type buttons are pressed in the edit form, I setvalue in this field back to null.
Jul 26 '07 #5

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

Similar topics

0
by: Andrew Cutforth | last post by:
I have a strange problem that I have not come across before. In a multi user situation I have a readonly query open. When another user tries to post a change to that record it says it is locked....
0
by: Andrew Cutforth | last post by:
I have a strange problem that I have not come across before. In a multi user situation I have a readonly query open. When another user tries to post a change to that record it says it is locked....
6
by: DebbieG | last post by:
I have created a database for a client and was told that it was to be a one-user database. Well, you know the next statement ... now they want 3 people to be able to use the database. (FYI, I...
5
by: Ross A. Finlayson | last post by:
Hi, I'm scratching together an Access database. The development box is Office 95, the deployment box Office 2003. So anyways I am griping about forms and global variables. Say for example...
19
by: rich | last post by:
I am building an app using php and postgresql. My questionis this. How do you handle people wanting to make parallel changes to a record. Since in web apps you are doing a select, bring over a...
5
by: payffl | last post by:
My users are running Access '03. They have a database with a form that allows them to enter new records. Frequently they will move to a new record and not enter any information. This prevents...
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...
1
by: javediq143 | last post by:
Hi All, This is my first post in this forum. I'm developing a CMS for my latest website. This CMS is also in PhP & MySQL. I'm done with the ADD section where the Admin can INSERT new records in...
1
Dököll
by: Dököll | last post by:
Hey Ladies and Gents! I would like to permit only one user edit to a row in a database. I am a firm believer at having the db do most of the work but the app I am maintaining could use some...
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: 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: 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:
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,...
0
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...
0
agi2029
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 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.