----- Original Message -----
From: "proto type"
Subject: [PCSOFT] Visual Basic Problem
> Dear list members,
> can anyone tell me how to verify if a numeric value was entered by the user
> to a textbox on visual basic programs, please?
> For example, I'm prompting the user to enter an integer number in a text box
> on the form and I want to avoid the input of other characters. if the user
> enters non numeric value, i want it to be detected and prompt the user
> again. I use VB6 learning edition.
> thanks in advance for any response,
> ahror rahmedov
--------------------
Use a variation of this under the Lost_Focus event for the textbox in question:
If IsNumeric(txtName.Text) = False Then
Call MsgBox("Invalid input", vbInformation + vbOKOnly, "Please enter numbers only")
txtName.Text = vbNullString
Else
txtName.Text = txtName.Text
End If
----------------------------------------
If you need further help, you can email me directly. Good luck
Alan Thompson
The NOSPIN Group is now offering Free PC Tech
support at our newest website:
http://freepctech.com
|