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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
| Private Sub Commande42_Click()
Dim cnAccess As New ADODB.Connection
Dim rstRecordset1 As New ADODB.Recordset
Set cnAccess = CurrentProject.Connection
Dim response As Integer, stroptions As String, strnum As String
Dim strNom As String, strSalle As String, strComm As String
Dim dteDate As Date, dtebeg2 As Date, dteend2 As Date
If Check4.Value = True Then
stroptions = "TV "
End If
If Check6.Value = True Then
stroptions = stroptions + "Video "
End If
If Check8.Value = True Then
stroptions = stroptions + "Projecteurs "
End If
If Check10.Value = True Then
stroptions = stroptions + "Audio "
End If
If Check14.Value = True Then
stroptions = stroptions + "Grand écran "
End If
strNom = Text16
strComm = Texte22
strSalle = Combo2
dteDate = Text20
strnum = Texte34
dtebeg2 = Texte30
dteend2 = Texte28
response = MsgBox("Modifier cette réservation ?", vbYesNo, "Controle")
If response = vbYes Then
DoCmd.SetWarnings False
DoCmd.RunSQL "UPDATE Réservation SET Date = #" & dteDate & "#, salle = '" & strSalle & "', nom = '" & strNom & "', options = '" & stroptions & "', Comm = '" & strComm & "', heurec = #" & dtebeg2 & "#, heuref = #" & CStr(dteend2) & "# WHERE resnum = '" & strnum & "'"
DoCmd.SetWarnings True
End If
End Sub |
Partager