I want to how can I display a custom message when I have a write conflit.
The purpose of my question is to have a custom message when a user try to update a record that is already updated by another user (optimistic locking).
You can capture the error in a form's On Error event and display your own message instead of the standard Access message. If you use action queries in VBA code, you should be able to use the VBA Error Handler. This technique will not work if users delete records in data sheets.
Private Sub Form_Error(DataErr As Integer, Response As Integer)
Dim strMsg As String
If DataErr = 7787 Then
' continue after displaying the message
Response = acDataErrContinue
strMsg = "Someone else update the record."
MsgBox strMsg
End If
End Sub Terry L. Broadbent FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.