Results 1 to 6 of 6
  1. #1
    jbailey4545 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2012
    Posts
    14

    Write Conflict Help

    Would it be possible to combine records when a Write Conflict happens?

    I was looking at using the Form_error event and doing something like this but I don't know how to get the data to combine.

    Private Sub Form_Error(DataErr As Integer, Response As Integer)
    If DataErr = 7787 Then
    'Put code here to combine data
    End If
    End Sub

    ***Update This is what I have so Far. It adds the data but overwrite what was saved by other user. Is there an append function for this?

    Dim rst As New ADODB.Recordset
    rst.Open "tableName", CurrentProject.Connection, adOpenKeyset, adLockPessimistic
    With rst


    .Update
    !key = "PrimaryKey" 'Primary Key of record that needs to be updated
    !fieldname = Me.FieldName
    .Update
    .Close
    End With
    Set rst = Nothing
    End If

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Never heard of anyone trying this.

    One user edit must be completed first and committed to table before another edit of same record can be accomplished. I don't see any way around that.

    Does write conflict happen a lot in this db? Maybe need to look at business practice and procedures that cause users to edit same record at same time.

    APPEND would create a new record, not edit the existing record. Yes, can add record to recordset.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    jbailey4545 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2012
    Posts
    14
    I have figured out that append would not work. I understand that a user edit must be completed before another edit can be made. I'm just testing. I was thinking that since the Write Conflict only occurs when 2 users open a record at the same time and one user saves first and then the 2nd user tries to save the Write Conflict occurs. So would it be possible to take the data from the field in the table and merge it with the field from the form then bypass the write conflict error. Does that make sense?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Kinda makes sense, no idea if it is possible. Not something I have to deal with. Think we have had write conflict maybe twice in 6 years with my primary database.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    jbailey4545 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2012
    Posts
    14
    I was able to do it. I opened a recordset which grabbed the data from the first user save and compared it to the data on the form. I then set the table field to both the data on the form and from the recordset

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Congratulations! Thanks for sharing idea, very creative.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Write conflict
    By IslandHydro in forum Programming
    Replies: 4
    Last Post: 10-25-2013, 09:30 AM
  2. write conflict error
    By nyneave in forum Security
    Replies: 1
    Last Post: 10-13-2012, 06:17 PM
  3. Write Conflict
    By sah in forum Forms
    Replies: 8
    Last Post: 04-25-2012, 07:19 AM
  4. Write Conflict Demonstration
    By pkstormy in forum Code Repository
    Replies: 1
    Last Post: 12-02-2010, 08:25 PM
  5. Write Conflict Error
    By botts121 in forum Access
    Replies: 5
    Last Post: 09-25-2009, 12:11 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums