Solved

Avoiding Write Conflict message...

Posted on 2012-12-24
4
636 Views
Last Modified: 2012-12-24
I have a drop-box on a main form. There is a subform on the main form.

After update of the drop-box on the main form, the following code update the recordsour-table of the subform:

    
    CurrentDb.Execute "Update tOwnerDRF_Titles Set BU_ID=" & Me!cboBusinessUnit & " Where OwnerDRF_ID=" & Me!OwnerDRFID
    
    'Me!sfDRF_TitlesTempUpload.Form.Dirty = False
    'Me!sfDRF_TitlesTempUpload.Form.RecordSource = Me!sfDRF_TitlesTempUpload.Form.RecordSource

Open in new window


However, When I go from one record on the main form, I get "Write Conflict" message which I am trying to avoid. Additional information is provided on the attached image.

Question: How can I get rid of the "Write Conflict" message?

Thank you.
writeconflict.png
0
Comment
Question by:Mike Eghtebas
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 75
ID: 38719144
You can't really avoid the WC message. However, you can trap those error codes - and that error is only rendered in the Form Error event.  There, you can display any message you want to the user.  However, the standard WC message is already pretty good ... and generic Microsoft error messages go.

mx
0
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 500 total points
ID: 38719155
** Example **

Private Sub Form_Error(DataErr As Integer, Response As Integer)
    Response = acDataErrContinue
    Select Case DataErr
       
        Case 3197, 7787, 7878  'Write conflict error numbers
            MsgBox "It appears that another user is trying to Submit the exact same queue record (same AcctID) at the same time you are, which has resulted in a 'Write Conflict' situation." & Chr(13) & Chr(13) & _
                         "Consequently, please take the following action:" & Chr(13) & Chr(13) & _
                         "1) Write down this queue AcctID (" & lAcctID & "), close the Disposition window, then Queues>>Load My Group Queues (or All Queues if necessary), locate the AcctID and see what changes have been made. However, if the queue was Completed by someone else, you will not be able to locate the queue." & Chr(13) & Chr(13) & _
                         "2) Please take a screen shot of this message and email it to the Database Administrator." & Chr(13) & Chr(13) & _
                         "Please note this is not really an error, however we need to track the frequency of occurrence of write conflicts, hence the need for the screen shot." & vbCrLf & vbCrLf & _
                         "Write Conflict Information --------------------" & Chr(13) & _
                         "Err Number: " & Err.Number & Chr(13) & _
                         "Description: " & Err.Description & vbCrLf & _
                         "Code Fx: " & sFx & vbCrLf & vbCrLf & _
                         "Line Number: " & Erl, 48, "Queue Disposition - Submit - Possible Write Conflict"

        Case Else
            MsgBox "An unexpected error occurred " & DataErr & "  " & AccessError(DataErr)
    End Select
End Sub
0
 
LVL 34

Author Closing Comment

by:Mike Eghtebas
ID: 38719289
Thank you.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 38719294
Are the master/child links set on the subform?

If all the combobox on the main form does is filter the records in the subform, then you can even use the simple code the wizard creates:

    ' Find the record that matches the control.
    Dim rs As Object
    Set rs = Me.Recordset.Clone
    rs.FindFirst "[CustID] = " & Str(Nz(Me![cboCustID], 0))
    If Not rs.EOF Then Me.Bookmark = rs.Bookmark

JeffCoachman
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question