Solved

Avoiding Write Conflict message...

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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

636 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