|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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> |
|
#2
|
|||
|
|||
|
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 |
|
#3
|
|||
|
|||
|
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? |
|
#4
|
|||
|
|||
|
What version of VB. In VB6 look at the properties of the text control.
|
|
#5
|
|||
|
|||
|
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? |
|
#6
|
|||
|
|||
|
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. |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Validate a Field |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|