begin process at 2010 02 10 02:28:05
  Trouver un code source :
 
dans
 
Accueil > 

Code

 > 

Tutoriaux

 > VALIDATION FORMULAIRE

VALIDATION FORMULAIRE


 Information sur la source

Note :
Aucune note
Catégorie :Tutoriaux Niveau :Débutant Date de création :07/06/2002 Date de mise à jour :07/06/2002 16:49:39 Vu / téléchargé :4 240 / 286

Auteur : xvanneste

Ecrire un message privé
Site perso
Commentaire sur cette source (1)
Ajouter un commentaire et/ou une note

 Description

Petit code afin de reviser ou d'apprendre comment on valide des données entrées dans un formulaire

Source

  • Private Sub txtName_KeyPress(KeyAscii As Integer)
  • KeyAscii = Asc(UCase(Chr(KeyAscii)))
  • End Sub
  • Private Sub txtNumDays_KeyPress(KeyAscii As Integer)
  • If Chr(KeyAscii) = vbBack Or Chr(KeyAscii) = "-" Or Chr(KeyAscii) = "(" Or Chr(KeyAscii) = ")" Then Exit Sub
  • If Not IsNumeric(Chr(KeyAscii)) Then
  • Beep
  • KeyAscii = 0
  • staAdditionalInfo.Panels("addInfo").Text = "Valeur numerique uniquement."
  • End If
  • End Sub
  • Private Sub txtNumDays_LostFocus()
  • If MaskEdBox1.ClipText <> "" And txtNumDays.Text <> "" Then
  • txtCheckOut.Text = Format(DateAdd("d", Val(txtNumDays.Text), MaskEdBox1.Text), "dd-mm-yyyy")
  • End If
  • End Sub
  • Private Sub txtNumPeople_KeyPress(KeyAscii As Integer)
  • If Chr(KeyAscii) = vbBack Or Chr(KeyAscii) = "-" Or Chr(KeyAscii) = "(" Or Chr(KeyAscii) = ")" Then Exit Sub
  • If Not IsNumeric(Chr(KeyAscii)) Then
  • Beep
  • KeyAscii = 0
  • staAdditionalInfo.Panels("addInfo").Text = "Valeur numerique uniquement."
  • End If
  • End Sub
  • Private Sub txtPhone_KeyPress(KeyAscii As Integer)
  • If Chr(KeyAscii) = vbBack Or Chr(KeyAscii) = "-" Or Chr(KeyAscii) = "(" Or Chr(KeyAscii) = ")" Then Exit Sub
  • If Not IsNumeric(Chr(KeyAscii)) Then
  • Beep
  • KeyAscii = 0
  • staAdditionalInfo.Panels("addInfo").Text = "le numero de téléphone est numerique."
  • End If
  • End Sub
Private Sub txtName_KeyPress(KeyAscii As Integer)
    KeyAscii = Asc(UCase(Chr(KeyAscii)))
End Sub

Private Sub txtNumDays_KeyPress(KeyAscii As Integer)
    If Chr(KeyAscii) = vbBack Or Chr(KeyAscii) = "-" Or Chr(KeyAscii) = "(" Or Chr(KeyAscii) = ")" Then Exit Sub
    If Not IsNumeric(Chr(KeyAscii)) Then
        Beep
        KeyAscii = 0
        staAdditionalInfo.Panels("addInfo").Text = "Valeur numerique uniquement."
    End If

End Sub

Private Sub txtNumDays_LostFocus()
    If MaskEdBox1.ClipText <> "" And txtNumDays.Text <> "" Then
        txtCheckOut.Text = Format(DateAdd("d", Val(txtNumDays.Text), MaskEdBox1.Text), "dd-mm-yyyy")
    End If
End Sub

Private Sub txtNumPeople_KeyPress(KeyAscii As Integer)
    If Chr(KeyAscii) = vbBack Or Chr(KeyAscii) = "-" Or Chr(KeyAscii) = "(" Or Chr(KeyAscii) = ")" Then Exit Sub
    If Not IsNumeric(Chr(KeyAscii)) Then
        Beep
        KeyAscii = 0
        staAdditionalInfo.Panels("addInfo").Text = "Valeur numerique uniquement."
    End If

End Sub

Private Sub txtPhone_KeyPress(KeyAscii As Integer)
    If Chr(KeyAscii) = vbBack Or Chr(KeyAscii) = "-" Or Chr(KeyAscii) = "(" Or Chr(KeyAscii) = ")" Then Exit Sub
    If Not IsNumeric(Chr(KeyAscii)) Then
        Beep
        KeyAscii = 0
        staAdditionalInfo.Panels("addInfo").Text = "le numero de téléphone est numerique."
    End If
End Sub


 Conclusion

ceci est un exemple qui permet de se familiariser avec la validation au niveau champ ou au niveau feuille

 Fichier Zip

Les Membres Club peuvent télécharger directement un fichier contenu dans le zip sans télécharger le zip en entier !

Télécharger le zip


 Sources du même auteur

Source avec Zip JACKPOT

 Sources de la même categorie

Source avec Zip Source avec une capture APPLICATION WEB POUR LA GESTION D'UNE AGENCE DE LOCATION DE ... par rachid1449
Source avec Zip COURS DE PILOTAGE........D'APPLICATIONS par Renfield
Source avec Zip Source .NET (Dotnet) DLL POUR K8055 (VM110) UTILISATION SIMPLIFIÉE DE CETTE CARTE par Adn56
Source avec Zip Source avec une capture Source .NET (Dotnet) GESTION MULTICARTES K8055 (CODE TUTO) par Adn56
Source avec Zip Source avec une capture Source .NET (Dotnet) SPAM ANTI SPAM par bouv

Commentaires et avis

Commentaire de noe le 07/06/2002 18:06:00

bonjour

petit sousis message "remplissez touts les champs"
mais le champ date de départ non accesible

a+

 Ajouter un commentaire




Nos sponsors


Sondage...

CalendriCode

Février 2010
LMMJVSD
1234567
891011121314
15161718192021
22232425262728

Consulter la suite du CalendriCode

 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 0,889 sec (4)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales