You could try something like this...
[CODE=vb]Dim s As String
Const Digits as String = "0123456789 "
s = Trim$(text1.Tex t)
If s = Format(Val(s)) Then
MsgBox "Looks like a number - hooray!"
ElseIf s = "0" Then
' Zero.
MsgBox "Zero"
ElseIf Instr(Digits, Left$(s, 1)) = 0 Then
' Doesn't start with a numeric digit.
MsgBox "Doesn't start with a numeric digit."
Else
MsgBox "I'm going to use the number " & Val(s)
End If[/CODE]
[CODE=vb]Dim s As String
Const Digits as String = "0123456789 "
s = Trim$(text1.Tex t)
If s = Format(Val(s)) Then
MsgBox "Looks like a number - hooray!"
ElseIf s = "0" Then
' Zero.
MsgBox "Zero"
ElseIf Instr(Digits, Left$(s, 1)) = 0 Then
' Doesn't start with a numeric digit.
MsgBox "Doesn't start with a numeric digit."
Else
MsgBox "I'm going to use the number " & Val(s)
End If[/CODE]
Comment