1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| Dim strsQL As String
Dim RS
OpenConnexion Fichier
Sql = "select * from [" & Feuille & "] where [NUM_PROJET]='" & Trim(TextBox1.Value) & "';"
Set RS = CreateObject("adodb.recordset")
RS.Open Sql, Cnx
If RS.EOF = False Then
MsgBox "Existe"
Else
strsQL = "insert into [" & Feuille & "] ([NUM_PROJET],[TYPE_DE_PROJET],[CHEF_DE_PROJET],[SOUS-TRAITANT],[CONSULTANT],[OBJET],[CLIENTS],[LIEU_DE_DEPOT],[DATE_DE_DEPOT],[HEURE_DEPOT]) "
strsQL = strsQL & "Values ('" & Trim(TextBox1.Value) & "','" & Trim(ComboBox1.Value) & "','" & Trim(ComboBox2.Value) & _
"','" & Trim(ComboBox3.Value) & "','" & Trim(ComboBox4.Value) & "','" & Trim(TextBox2.Value) & "','" & Trim(ComboBox5.Value) & "','" & Trim(TextBox3.Value) & "','" & Trim(TextBox4.Value) & _
"','" & Trim(TextBox5.Value) & "');"
Cnx.Execute strsQL
'Set Cnx = Nothing
End If
RS.Close
Set RS = Nothing
Cnx.Close
Set Cnx = Nothing
Unload Me |
Partager