EnableMethodErrors example for Access 2.0

This example disables method errors temporarily so that it can give the user guidance about a particular error (an out-of-range shear angle in this case).

ShearAngle = 9000 ' This would be the user's input * 100
Me![LEAD1].Object.EnableMethodErrors = False

nRet = Me![LEAD1].Object.Shear(ShearAngle, TRUE, RGB(0,0,255))
If nRet = 20013 Then
   cMsg = "The angle cannot be more than 45 degrees"
   answer = MsgBox(cMsg, 0, "Error")
Else
   Me![LEAD1].Object.ForceRepaint
EndIf

Me![LEAD1].Object.EnableMethodErrors = True