Private Sub Command1_Click() MaConnection Dim y As Date Dim ms2 as Mshflexgrid sql = "select * FROM regle " If rs.State = adStateOpen Then rs.Close rs.Open sql, DB, adOpenKeyset, adLockPessimistic y = rs!date_ech If DateDiff("d", Date, y) = 10 Then sqlz = "select * from regle where date_ech=y" If rr.State = adStateOpen Then rr.Close rr.Open sqlz, DB, adOpenKeyset, adLockPessimistic Set ms2.DataSource = rr End If End sub
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionDim y As Date y = Date + 10 MaConnection sqlz = "select * from regle where date_ech=#" & CStr(Format(y, "MM/DD/YYYY")) & "#" If rr.State = adStateOpen Then rr.Close rr.Open sqlz, DB, adOpenKeyset, adLockPessimistic Set ms2.DataSource = rr