By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,107 Members | 1,323 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,107 IT Pros & Developers. It's quick & easy.

Write Conflict Error

100+
P: 121
HI I have the following code that updates a table


and everytime i run it i get a write conflict error but i am the only one using the database

i have tried setting all the number fields default value in the table where i am trying to edit the record to 0 but no luck

Please help before my head explodes!!!!


Regards Phill

Expand|Select|Wrap|Line Numbers
  1.  
  2.  
  3.     Dim dbsCurrent As Database
  4.     Dim dbsLinkedData As Database
  5.     Dim rstTblAssignHrs As dao.Recordset
  6.     Dim AssignID As Integer
  7.     Dim AssignIDForm As Integer
  8.  
  9.     Set dbsCurrent = CurrentDb
  10.     Set dbsLinkedData = DBEngine.OpenDatabase("C:\Database\ClientBooking\ExampleAccess2000")
  11.     Set rstTblAssignHrs = _
  12.         dbsLinkedData.OpenRecordset("T_AssignHours", dbOpenTable)
  13.  
  14. Do While Not rstTblAssignHrs.EOF
  15.  
  16.         AssignID = rstTblAssignHrs!AssignID
  17.         AssignIDForm = Forms![F_ArtistProj]![Child47].Form![AssignID]
  18.  
  19.         If AssignID = AssignIDForm Then
  20.  
  21.         rstTblAssignHrs.Edit
  22.         rstTblAssignHrs!assignhrsedit = True
  23.         rstTblAssignHrs.Update
  24.  
  25.        End If
  26.  
  27.        rstTblAssignHrs.MoveNext
  28.  
  29. Loop
  30.  
  31. End Sub
  32.  
  33.  
Feb 19 '09 #1
Share this Question
Share on Google+
1 Reply


100+
P: 121
Inserting this line before updatingthe recordset fixed it


Thanks anyway Phill

Expand|Select|Wrap|Line Numbers
  1.  
  2.  
  3. If Forms![F_ArtistProj]![Child47].Form.Dirty = True Then Forms![F_ArtistProj]![Child47].Form.Dirty = False
  4.  
  5.  
Feb 19 '09 #2

Post your reply

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