Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old February 28th, 2006, 09:33 PM
asptips asptips is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Location: asian
Posts: 389 asptips User rank is Sergeant (500 - 2000 Reputation Level)asptips User rank is Sergeant (500 - 2000 Reputation Level)asptips User rank is Sergeant (500 - 2000 Reputation Level)asptips User rank is Sergeant (500 - 2000 Reputation Level)asptips User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 4 Days 1 h 45 m 12 sec
Reputation Power: 16
Validate a Field

Hi,

How do I validate a a given field? Say I just want numbers or special characters to be inputted.
This one doesnt look good!
<code>
Private Sub Text1_Change() 'how about using Text1_KeyPress()?

If Text1.Text <> val(Text1.Text) Then
msgbox "Not a number"

End sub
</code>

Reply With Quote
  #2  
Old March 1st, 2006, 06:12 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 23 h 19 m 36 sec
Reputation Power: 181
Did you look at the format property for starters? And you can use the "causes validation" property on controls to run your validation code before the focus moves on to the next control.
__________________
======
Doug G
======
I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain

Reply With Quote
  #3  
Old March 1st, 2006, 08:32 PM
asptips asptips is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Location: asian
Posts: 389 asptips User rank is Sergeant (500 - 2000 Reputation Level)asptips User rank is Sergeant (500 - 2000 Reputation Level)asptips User rank is Sergeant (500 - 2000 Reputation Level)asptips User rank is Sergeant (500 - 2000 Reputation Level)asptips User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 4 Days 1 h 45 m 12 sec
Reputation Power: 16
Hi G,

I didnt see any format or validation property on a Textfield. Actually what I didnt get is the validation code itself . And what is this for STARTERS?

Reply With Quote
  #4  
Old March 1st, 2006, 11:09 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 23 h 19 m 36 sec
Reputation Power: 181
What version of VB. In VB6 look at the properties of the text control.

Reply With Quote
  #5  
Old March 3rd, 2006, 09:55 PM
asptips asptips is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Location: asian
Posts: 389 asptips User rank is Sergeant (500 - 2000 Reputation Level)asptips User rank is Sergeant (500 - 2000 Reputation Level)asptips User rank is Sergeant (500 - 2000 Reputation Level)asptips User rank is Sergeant (500 - 2000 Reputation Level)asptips User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 4 Days 1 h 45 m 12 sec
Reputation Power: 16
I'm using vb6 and STILL haven't found any FORMAT or VALIDATION property on a Textfield.

In there are Font,Forecolor and Visible. (that start with F & V )

Do I have to install some package to get those properties?

Reply With Quote
  #6  
Old March 3rd, 2006, 10:21 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 23 h 19 m 36 sec
Reputation Power: 181
Look for Causes Validation property in the properties window, and hit F1 to get details of the property. You have to read a bit to understand the concept that the Causes Validation property isn't for the control you're leaving, but that it fires off validation events for the previous control when you are entering the control.

I might have been thinking of DataFormat property if your control is data bound, or maybe thinking of an Access text field that has a format property.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Validate a Field


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT