Microsoft Access 2010 Bible

(Rick Simeone) #1

Chapter 21: Building Multiuser Applications


779


Next lngCounter
ErrorRoutine = 3
Else
Call ParseError(Err, Error)
ErrorRoutine = 4
End If
Case 3188
‘3188-Record is locked by another
‘ session on the same machine:
MsgBox “The record could not be locked “
& “because it is locked on your machine”
Case 3197
‘3197—Data has changed; Operation stopped.
‘ Offer the user a chance to cancel or save:
strMessage = “The record you are trying “

& “to save has been changed “
& “since your edit began” & vbCrLf & vbCrLf

& “Do you want to save it anyway?”
lngReturn = MsgBox(strMessage, vbYesNo)
Select Case lngReturn
Case vbYes
ErrorRoutine = 3
Case vbNo
ErrorRoutine = 4
End Select
Case 3260
‘3260—Couldn’t Update; currently
‘locked by user x on machine y:
If TryCount < 10 Then
For lngCounter = 0 To 15000
‘Empty loop for short delay...
Next lngCounter
ErrorRoutine = 3
Else
Call ParseError(Err, Error)
ErrorRoutine = 4
End If
Case 3421
‘3421- Data type conversion error.
strMessage = “This Add was canceled due “ _
& “to a type conversion error”
Call MsgBox(strMessage, vbOKOnly)
Case Else
strMessage = “The Error Number Was “ & Err & “ “ & Error
Call MsgBox(strMessage, vbInformation)
End Select
End Function

Free download pdf