Code vb

Fermé
sana SBHA Messages postés 1 Date d'inscription jeudi 22 avril 2010 Statut Membre Dernière intervention 22 avril 2010 - Modifié par jipicy le 22/04/2010 à 16:14
korabiqua Messages postés 3 Date d'inscription jeudi 22 avril 2010 Statut Membre Dernière intervention 25 avril 2010 - 22 avril 2010 à 16:58
je sais pas kel est ma faute ??? SVP aidez moi et mercii d'avance

Private Sub Command1_Click(Index As Integer)
Me.Hide
End Sub

Private Sub Command2_Click()
Dim req1, reponce, reponce1, req, str As String
Dim ENTIER As Integer
reponce = ""
reponce1 = ""
ENTIER = Val(text1.Text)
If ENTIER = 0 Then
MsgBox "Matricule est de type entier"
text1.Text = ""
Else

If text1.Text = "" Or Text2.Text = "" Or Text3.Text = "" Or Text4.Text = "" Or Text5.Text = "" Then
MsgBox "Remplir les cases vides"
Else

req1 = "select Matricule from utilisateur where Matricule= '" & text1.Text & "' "
With Record
.ActiveConnection = Conn
.Source = req1
.Open


End With
While Not Record.EOF
' List1Douilles.AddItem CADRecord(1).Value & " / " & CADRecord(2).Value
reponce = Record(0).Value
Record.MoveNext
Wend
Record.Close
req1 = "select Login from utilisateur where Login= '" & Text4.Text & "' "

With Record
.ActiveConnection = Conn
.Source = req1
.Open


End With
While Not Record.EOF
' List1Douilles.AddItem CADRecord(1).Value & " / " & CADRecord(2).Value
reponce1 = Record(0).Value
Record.MoveNext
Wend
Record.Close


If reponce = "" And reponce1 = "" Then

req = "insert into utilisateur(Matricule,Nom,Prenom,Login,Motpass,Profil) values ('" & text1.Text & "','" & Text2.Text & "','" & Text3.Text & "','" & Text4.Text & "' ,'" & Text5.Text & "','" & Combo1.Text & "')"

With Record
.ActiveConnection = Conn
.Source = req
.Open


End With
Ajouterutilisateur.Visible = False
a = MsgBox(" Utilisateur ajouter avec succée!!", vbOKCancel, "Confirmation")
If (a = vbOK) Then
Menu_Principale.Visible = True
Else: Ajouterutilisateur.Show
End If

Else
MsgBox "Utilisateur existe"


End If
text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""

End If
End If
End Sub

End Sub



A voir également:

2 réponses

Polux31 Messages postés 6917 Date d'inscription mardi 25 septembre 2007 Statut Membre Dernière intervention 1 novembre 2016 1 204
22 avril 2010 à 15:26
Bonjour,

1) un BONJOUR, un MERCI peuvent engager un helpeur à intervenir.

2) Quelle application utilises-tu ? Quel est le message d'erreur et sur quelle ligne ?

Nous n'avons pas forcément une boule cristal sous la main !!!
0
korabiqua Messages postés 3 Date d'inscription jeudi 22 avril 2010 Statut Membre Dernière intervention 25 avril 2010
22 avril 2010 à 16:58
laisse moi de temps ok.mainent j' un examen ok
0