Solved

Avoiding Write Conflict message...

Posted on 2012-12-24
4
619 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

758 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

20 Experts available now in Live!

Get 1:1 Help Now