限制输入为数字,并限制数字长度
Private Sub aa_BeforeUpdate(Cancel As Integer)
If IsNumeric(Me.aa) = False Then
MsgBox "您输入的不是数字,请输入数字!", vbOKOnly, "提示:"
Me.aa = Null
End If
If Len(Me.aa) <> 3 Then
MsgBox "您输入的数据长度不等于3!请输入在3位以内!", vbOKOnly, "提示:"
Me.aa = Null
End If
End Sub