Dim selID
selID = Text1.Text
If selID <> vbNullString Then
If VarType(selID) <> vbInteger Then
Text1.SetFocus
Text1.Text = vbNullString
End If
End If
I want to make sure only an Integer can be entered.
So If the text box isnt Null then check the Type
If Not an Int then clear text box and set focus.
Unfortunately for some reason it wont even allow Ints
Tried entering 2,3,4, etc all clear the text box and set focus.....WHY?????
selID = Text1.Text
If selID <> vbNullString Then
If VarType(selID) <> vbInteger Then
Text1.SetFocus
Text1.Text = vbNullString
End If
End If
I want to make sure only an Integer can be entered.
So If the text box isnt Null then check the Type
If Not an Int then clear text box and set focus.
Unfortunately for some reason it wont even allow Ints
Tried entering 2,3,4, etc all clear the text box and set focus.....WHY?????