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
| 'MsgBox (DateCA)
LeSql = "SELECT facture_clients.* " & _
"FROM facture_clients " & _
"WHERE facture_clients.date_reglement=#" & Format(dateC, "yyyy-mm-dd") & "#"
Set rsRdV = CurrentDb.OpenRecordset(LeSql, dbOpenForwardOnly)
' s'il y a un rdv alors copier dans la variable DateC l'horaire de début du rdv.
If Not (rsRdV.EOF) Then
'MsgBox (rsRdV!n_facture)
'MsgBox (rsRdV!nom_client)
DoCmd.OpenForm "F_details"
F_details.Form.RecordSource = rsRdV
'[F_details].Form.RecordSource = rsRdV
' ouvre le formulaire " F_RendezVous "
Forms!F_details![n_facture] = rsRdV![n_facture]
Forms!F_details![nom_client] = rsRdV![nom_client]
Forms!F_details![montant_HT] = rsRdV![montant_HT]
Forms!F_details![montant_TTC] = rsRdV![montant_TTC]
Forms!F_details!TVA = rsRdV!TVA
Forms!F_details![date_reglement] = rsRdV![date_reglement]
Forms!F_details![Montant_reglé] = rsRdV![Montant_reglé]
Forms!F_details![Reste] = rsRdV![Reste]
Else
MsgBox ("Il n'y pas de réglement pour cette date!")
' Forms!F_RendezVous!HoraireF = Format(DateAdd("n", 30, DateC), "hh:nn")
End If
rsRdV.Close
Set rsRdV = Nothing
End Sub |
Partager