Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: ERROR TRAPPING AND CANCEL TO ALLOW FURTHER CHANGES


Message #1 by "Sean Bornstein" <bostonroxx@a...> on Wed, 18 Jul 2001 01:13:12
Hello all.   I have some error trapping that traps a Write Conflict.  I 

want to be able to UNDO the changes and allow the user to move off the 

textbox.  Here is what I have any ideas how to undo the save to allow the 

user to continue?



Private Sub Form_Error(DataErr As Integer, Response As Integer)

Select Case DataErr

  Case 3260

     Response = acDataErrContinue

     MsgBox "Record is being edited by another user, please try again 

later: Err 3260", vbExclamation

     DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70

     End

  Case 2757

     Response = acDataErrContinue

     MsgBox "Record is being edited by another user, please try again 

later: Err 2757", vbExclamation

     DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70

     End

Case Else

     Response = acDataErrContinue

     MsgBox "Record is being edited by another user, please try again 

later:" & DataErr, vbExclamation

     DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70

     End

End Select

End Sub
Message #2 by "Pardee, Roy E" <roy.e.pardee@l...> on Wed, 18 Jul 2001 07:07:23 -0700
Have you tried the Undo method of the form, e.g., Me.Undo?  I'm not sure if

that will work, but it's worth a try...



Cheers,



-Roy



-----Original Message-----

From: Sean Bornstein [mailto:bostonroxx@a...]

Sent: Tuesday, July 17, 2001 6:12 PM

To: Access

Subject: [access] ERROR TRAPPING AND CANCEL TO ALLOW FURTHER CHANGES





Hello all.   I have some error trapping that traps a Write Conflict.  I 

want to be able to UNDO the changes and allow the user to move off the 

textbox.  Here is what I have any ideas how to undo the save to allow the 

user to continue?



Private Sub Form_Error(DataErr As Integer, Response As Integer)

Select Case DataErr

  Case 3260

     Response = acDataErrContinue

     MsgBox "Record is being edited by another user, please try again 

later: Err 3260", vbExclamation

     DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70

     End

  Case 2757

     Response = acDataErrContinue

     MsgBox "Record is being edited by another user, please try again 

later: Err 2757", vbExclamation

     DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70

     End

Case Else

     Response = acDataErrContinue

     MsgBox "Record is being edited by another user, please try again 

later:" & DataErr, vbExclamation

     DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70

     End

End Select

End Sub






  Return to Index