If InStr(Text.Text, ".") Then
MsgBox "是浮点!,请输入整形变量 范围在-32768和+32767之间"
Text.SetFocus
Else
On Error GoTo errorinfo
myobject1.n = CInt(Text.Text)
Exit Sub
End If
Else
MsgBox "您输入的不是数字,请输入整形变量 范围在-32768和+32767之间", vbOKOnly, "提醒"
Text.SetFocus
End If
errorinfo:
If Err.Number = 6 Then
MsgBox "超出integer类型范围限制!,请输入整形变量 范围在-32768和+32767之间"
Text.SetFocus
End If