Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IsNumeric Function Question!

Status
Not open for further replies.

tekvb1977

Technical User
Nov 16, 2005
46
US
I have a text box on my form. I like the user to only input an integer number. However if they input multiple numbers separated by commas, I like to display a message.

I am using this:

If IsNumeric (Forms![MainForm]![tbx_VB].Value) = False Then
MsgBox "Please enter a numeric number"
End If

However, when I check the if condition for 789,588
it doesn't hold true. For some reason it's still considering 789,588 as numeric when infact it should be treated as a alpha numeric character and the if condition should hold true.

How to make it work? Any suggestions/ideas. Thanks a bunch in advance.

J
 
Hi.

Try this:

If Val (Forms![MainForm]![tbx_VB].Value) <> Forms![MainForm]![tbx_VB].Value then

ChaZ



There Are 10 Types Of People In The world:
Those That Understand BINARY And Those That Don’t.
 
This VB6 FAQ can be used with Access VBA.
How do I make sure that only numbers are entered into a text box? faq222-45 or faq222-302

________________________________________________________
Zameer Abdulla
Help to find Missing people
Do not cut down the tree that gives you shade.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top