Private Sub Command1_Click()
If Len(Text1) <> 20 Then
MsgBox "只能输入20位数字"
ElseIf Left(Text1, 3) <> 159 And Left(Text1, 3) <> 753 Then
MsgBox "开头数字必须为159或753,请重新输入"
End If
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If InStr("0123456789", Chr(KeyAscii)) = 0 Then
MsgBox "错误,只能输入0-9的阿拉伯数字"
KeyAscii = 0
End If
End Sub
温馨提示:答案为网友推荐,仅供参考