ACCESS 西暦を入力する入力制限(テキストボックス)

入力規則
(>=2000 And <=3000) Or Is Null

エラーメッセージ
西暦を入力してください

小数点を入れたりして5文字を超えたとき

変更時イベント

Private Sub txtEY_Change()

If Len(Me.txtSY.Text) > 4 Then
MsgBox (“4桁の数字を入れてください”)
Me.txtSY = Null
End If

End Sub