奇怪,俺输入0时,居然被认为不是数值型数据.现求助!
If IsNumeric(Me.Text5) = False Then
Text5.SetFocus
Text5.SelStart = 0
Text5.SelLength = Len(Text5.Text)
MsgBox "请在数量中输入数值型数据!", 64, "提示"
Exit Sub
End If
If IsNumeric(Me.Text5) = False Then
Text5.SetFocus
Text5.SelStart = 0
Text5.SelLength = Len(Text5.Text)
MsgBox "请在数量中输入数值型数据!", 64, "提示"
Exit Sub
End If
if not isnumeric(text5.text) then
msgbox "请输入数值型数据!",48,"提示"
text5.setfocus
end if
end if
If KeyCode = vbKeyReturn Then
If IsNumeric(Me.Text5) = False Then
Text5.SetFocus
Text5.SelStart = 0
Text5.SelLength = Len(Text5.Text)
MsgBox "请在数量中输入数值型数据!", 64, "提示"
Exit Sub
Else
MsgBox "输入的是数值型数据!", 64, "提示"
End If
End If
End Sub
if step=1 thenend if
如果你是放到keydown事件中
那么当你第一次输入时,是会提示的,
因为第一次输入时,文本框为空,这样isnumeric就不是true了