Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Which event precedes "another user has changed record" error?

Status
Not open for further replies.

MacroScope

Programmer
Jul 17, 2010
286
0
0
US
I have written a live queue for an insurance company. When a user inputs info on a web form it is immediately placed in a staging table in Access 2007 housed on SQL Server 2008. The count of unassigned records in the queue is displayed on all screens and updated every 5 seconds. A double-click on one field of the queue form causes an append query to run to append the chosen record of web info to our main data table and it then opens the already fully populated record on screen for attention.

The overall system works perfectly, but the problem I'm having is that it's not infrequent that two people try to double-click the same record at approximately the same time, causing duplicates and confusion. Using record locks I can get the standard clipboard error, "Another user has changed the data..." to occur, which accomplishes the task of halting the second record writing process, but I am not satisfied to leave it that way. Is there a particular property that evaluates to true that I can use to detect the potential for the error before it happens, so that I can stop the actions before writing to the record and causing the actual error?

I thought that the Dirty property might work, but it seems to be only for the form you're writing on at the time, and not for the database state. DataChange evaluates to a string, and while I can use a Len() operation to detect if the string is greater than zero length and get a True-False result, that doesn't seem to work for the underlying table, but instead only for the form on screen.

The very first operation is to change the text in [QuoteStatus] from "Unassigned" to "Assigned".

I essentially would like to determine in advance that if I proceed with the write operation the error will occur and be able to use that to stop all activity and just pop a message saying the record is already assigned to someone else.

I hope that's clear enough.

As always, all help is greatly appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top