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
- Private Sub Command1_Click()
-
Debug.Print IsNumeric(Text1.Text)
-
End Sub
-
-
A few sample results...
- Input Output
-
Text1 False
-
123 True
-
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.