By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,501 Members | 2,805 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,501 IT Pros & Developers. It's quick & easy.

Validation of decimal numbers in textboxes

P: 1
Hi,
Newbie.. Would like to know how should I validate a decimal number in a textbox?
tried IsNumeric but in vain does not recognise the decimal parts of it.

Regards,
Uday Padhye.
9819025325
(022)25476592.
Apr 10 '07 #1
Share this Question
Share on Google+
1 Reply


Expert 5K+
P: 8,434
Newbie.. Would like to know how should I validate a decimal number in a textbox?
tried IsNumeric but in vain does not recognise the decimal parts of it.
Can you show us the code? I have used IsNumeric (in VB6) and it handles decimals just fine.

I created a new project with a single form, added a textbox and a command button, and inserted this
Expand|Select|Wrap|Line Numbers
  1. Private Sub Command1_Click()
  2.   Debug.Print IsNumeric(Text1.Text)
  3. End Sub
  4.  
  5. A few sample results...
  6. Input   Output
  7. Text1   False
  8. 123     True
  9. 123.45  True
Um... if the problem persists, try checking your Regional settings in Windows. Perhaps the decimal is different to what you (or VB) expect.
Apr 10 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.