Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Write conflit

Status
Not open for further replies.

poliv

Programmer
Jun 3, 2000
48
0
0
US
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).

Thanks
 

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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top