Computing.Net > Forums > Programming > vb validation

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

vb validation

Reply to Message Icon

Name: jimmy
Date: January 9, 2002 at 15:30:53 Pacific
Comment:

i need to validate some input from a text box. The input should only be real numbers, characters should be avoided. also the validation should make sure the user can only input 1 decimal point. i have been given many suggestions, but am having a lot of trouble doing it. if some has vb code please could you write the code when you reply to this.

thankyou




Sponsored Link
Ads by Google

Response Number 1
Name: Fred
Date: January 9, 2002 at 20:34:59 Pacific
Reply:

'I have two words for you!
'1)The first is: IsNumeric(X), it returns true if X is a number.

'2)And the second is: Format(X,"###0.000"), it formats the value of X.

'NOTE) Create a form with 1ea. textbox named Text1 and 1ea. label named Label1. Then paste the following code and run it. Hope this helps you out.
Private Sub Form_Load()
Label1.Width = 3500
Label1.Caption = "Please enter a number Then CLICK HERE!"
Text1.Width = 2000
End Sub

Private Sub Label1_Click()
Dim X
X = Format(Text1.Text, "###0.0")
If IsNumeric(Text1.Text) Then
Label1.Caption = "Your value >" & X & " < has been rounded!"
Else
Label1.Caption = "Numeric values only! Then CLICK HERE"
End If
End Sub


0

Response Number 2
Name: jimmy
Date: January 10, 2002 at 03:20:11 Pacific
Reply:

thankyou


0

Response Number 3
Name: sentha
Date: February 27, 2002 at 17:46:32 Pacific
Reply:

I want Date and Time Validation with

mm/dd/yy hh:mi am

format

thanks



0

Response Number 4
Name: Prithvi
Date: March 19, 2002 at 08:27:47 Pacific
Reply:

Hello,
I want only date to be validated which
is in MaskEdBox
Format:
dd/mm/yyyy

Thanks
Prithvi


0

Response Number 5
Name: abha soni
Date: May 22, 2002 at 06:39:33 Pacific
Reply:

i need how to apply date validations in vb and what are the conditions for which we can apply the validations.


0

Related Posts

See More



Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: vb validation

VB problem different language of Window www.computing.net/answers/programming/vb-problem-different-language-of-window/2878.html

VB weak language??????? www.computing.net/answers/programming/vb-weak-language/2620.html

Simple Maths Question VB/C++ Help! www.computing.net/answers/programming/simple-maths-question-vbc-help/6106.html