|
-
Nov 29th, 2000, 12:43 PM
#1
Thread Starter
Junior Member
I am trying to put in a check for an input box so I can tell if a numeric value was entered. What expression do I write to do this? If it is not numeric I will send an alert then set focus to that field to have then re-enter it.
-
Nov 29th, 2000, 12:54 PM
#2
Junior Member
IsNumeric
The IsNumeric(x) function returns a true/false for if "x" is numeric or not
-
Nov 29th, 2000, 12:55 PM
#3
Hyperactive Member
IsNumeric()
IsNumeric() works fine.
it obviously returns a boolean value.
IsNull() may also be helpful
-
Nov 29th, 2000, 12:56 PM
#4
Addicted Member
Use the ISNUMERIC() function
If not IsNumeric(MyTextBox) then
MsgBox "this value is not numeric"
end if
-
Nov 29th, 2000, 12:56 PM
#5
Junior Member
Chack this out
You can check for Numeric numbers using a function called IsNumeric.
Example:
If IsNumeric(Value) Then
'Do Whatever
Else
ControlName.Setfocus
MsgBox "You have to enter numeric values only."
End If
Rabih Waked
Using Visual Basic 6 Enterprise Edition with SP4.
The clock is ticking, the end of days
A journey awaits...
-
Nov 29th, 2000, 01:05 PM
#6
Thread Starter
Junior Member
Thanks everyone
I knew it was something simple like that but I couldn't remember.
-
Nov 29th, 2000, 01:23 PM
#7
Hyperactive Member
If you wanna be really COOL!!!!
hey hobbes,
if you wanna be really cool, you can call an API that
doesn't even allow you to enter numeric values while inside
the text box.
that way, you don't have to fool with the msgboxen (plural,hehe)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|