Thanks for the reply Daniel .... but I'm not trying to update the same record at the same time from two different directions ....
The SQL queries run first in another funtion. Then the recordset is created later on in the process. The more I test it I'm starting to believe that's not what's generating that error.
Even if I open a recordset in a function with no SQL query in it I still get that error when I try to update using the rst.Update command as shown below.
Dim rstaddit As ADODB.Recordset
Set rstaddit = New ADODB.Recordset
rstaddit.Open "SELECT * FROM CUSTSUMM", CurrentProject.Connection,
If rstaddit.RecordCount <> 0 Then
rstaddit.MoveFirst
Do Until rstaddit.EOF
If rstaddit!PD91_OVER < 10 Then
rstaddit!PD61_90 = rstaddit!PD61_90 + rstaddit!PD91_OVER
rstaddit!PD91_OVER = 0
rstaddit.Update <----------This generates the error
End If
etc.
etc.
ET
Main Topics
Browse All Topics





by: DanielWilsonPosted on 2009-09-03 at 14:25:19ID: 25255113
Yes, that happens when you update the same data from 2 different directions ... at least with optimistic locking.
You might experiment with pessimistic locking, but I don't recall whether that helps.
Alternatively, you can make one set of code put in some indication about what records it has open and make the other code check that before doing an update. It's cumbersome ... but you've got to break the concurrent update trap somehow.