Solved

Avoiding Write Conflict message...

Posted on 2012-12-24
4
624 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
  • 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 - Access MVP) 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 33

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

920 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now