Private Sub Form_Error(DataErr As Integer, Response As Integer)
Response = acDataErrContinue '既定アラート抑止
Select Case DataErr
Case 2113 '書式に適さなかった
MsgBox ActiveControl.Name & "は、○○です。", , "入力"
Case 2279 'InputMaskに違反
ActiveControl.Undo
Case 2107 '入力規則に違反
MsgBox ActiveControl.Name & "は、○○です。", , "入力規則違反"
Case 3314 '値要求
MsgBox ActiveControl.Name & "は、○○です。", , "入力必須"
Case 3939 '変更前データマクロでのエラー
Response = acDataErrDisplay
Case Else
Response = acDataErrDisplay
End Select
End Sub
0 件のコメント:
コメントを投稿