1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| Select Case Nz(Me.E_IdNdfKm, 0)
Case 0 ' Insert il s'agit d'une nouvelle Saisie
R_Sql = "INSERT INTO [T-NDFKm]" & _
"(IdConsultant,IdClient,DateTNDF,Type,Fournisseur,Montant,Km,Commentaire)" & _
" VALUES (" & _
"" & Nz(Me.IdConsultant, 0) & "," & _
"" & Nz(Me.E_IdClient, 0) & "," & _
"" & Convert_DateUS_Short(Nz(Me.E_DateIntervention, Date)) & "," & _
"'" & Protected_Quote(Nz(E_Type, "")) & "'," & _
"'" & Protected_Quote(Nz(E_Fournisseur, "")) & "'," & _
"" & Replace(Nz(E_Montant, 0), ",", ".") & "," & _
"" & Replace(Nz(E_Km, 0), ",", ".") & "," & _
"'" & Protected_Quote(Nz(E_Commentaire, "")) & "'" & _
")"
Case Else ' update d'une ligne existant
R_Sql = "UPDATE [T-NDFKm] SET [T-NDFKm].IdConsultant = " & Nz(Me.IdConsultant, 0) & _
",[T-NDFKm].IdClient = " & Nz(Me.E_IdClient, 0) & _
",[T-NDFKm].DateTNDF = " & Convert_DateUS_Short(Nz(Me.E_DateIntervention, Date)) & _
",[T-NDFKm].Type = '" & Protected_Quote(Nz(E_Type, "")) & "'" & _
",[T-NDFKm].Fournisseur = '" & Protected_Quote(Nz(E_Fournisseur, "")) & "'" & _
",[T-NDFKm].Montant = " & Replace(Nz(E_Montant, 0), ",", ".") & _
",[T-NDFKm].Km = " & Replace(Nz(E_Km, 0), ",", ".") & _
",[T-NDFKm].Commentaire = '" & Protected_Quote(Nz(E_Commentaire, "")) & "' "
R_Sql = R_Sql & "WHERE ((([T-NDFKm].N°)=" & Nz(Me.E_IdNdfKm, 0) & "));"
End Select |
Partager