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 50 51 52 53 54 55 56 57 58 59 60 61 62 63
| 'RECHERCHE RESA
Sub Recup_resa(date_resa As Date, chambre As Integer)
Dim Qry As DAO.QueryDef
Dim Rst As DAO.Recordset
Dim I As Integer
Dim trouve As Boolean
trouve = False
modifie = False
Set Qry = CurrentDb.QueryDefs("Requête2") ' AFFICHAGE RESERVATION AVEC REQUETE 2
Qry.Parameters("date_in") = date_resa
Qry.Parameters("chambre") = chambre
Set Rst = Qry.OpenRecordset
If Not Rst.EOF Then
If (Rst(0) = chambre) And ((Rst(1) = date_resa) Or (Rst(2) = date_resa)) Then
trouve = True
Form_RESA.Texte12 = Rst(3)
Form_RESA.Texte14 = Rst(4)
Form_RESA.Texte19 = Rst(1)
Form_RESA.Texte20 = Rst(2)
Form_RESA.Texte57 = Rst(8)
Form_RESA.Texte25 = Rst(11)
Form_RESA.Texte48 = Rst(13)
Form_RESA.Texte50 = Rst(12)
Form_RESA.Texte52 = Rst(14)
Form_RESA.Texte26 = Rst(10)
Form_RESA.Texte32 = Rst(9)
Form_RESA.Texte34 = Rst(15)
'If Rst(5) = True Then Form_RESA.Cocher54.Value = true Else Form_RESA.Cocher54.Value = False
End If
Set Qry = Nothing
Set Rst = Nothing
Else
Do
I = I + 1
Set Qry = CurrentDb.QueryDefs("Requête2") ' AFFICHAGE RESERVATION AVEC REQUETE 2
Qry.Parameters("date_in") = date_resa + I
Qry.Parameters("chambre") = chambre
Set Rst = Qry.OpenRecordset
If Not Rst.EOF Then
If ((Rst(0) = chambre) And (Rst(2) = date_resa + I)) Then
trouve = True
Form_RESA.Texte12 = Rst(3)
Form_RESA.Texte14 = Rst(4)
Form_RESA.Texte19 = Rst(1)
Form_RESA.Texte20 = Rst(2)
Form_RESA.Texte57 = Rst(8)
Form_RESA.Texte25 = Rst(11)
Form_RESA.Texte48 = Rst(13)
Form_RESA.Texte50 = Rst(12)
Form_RESA.Texte52 = Rst(14)
Form_RESA.Texte26 = Rst(10)
Form_RESA.Texte32 = Rst(9)
Form_RESA.Texte34 = Rst(15)
'If Rst(5) = True Then Form_RESA.Cocher54.Value = true Else Form_RESA.Cocher54.Value = False
End If
End If
Set Qry = Nothing
Set Rst = Nothing
Loop While trouve = False
End If
End Sub |
Partager