Solved

Avoiding Write Conflict message...

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Familiarize people with the process of utilizing SQL Server stored procedures 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 Micr…
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…

839 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