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 64 65 66 67 68 69 70
|
Option Compare Database
Global liste(100, 100)
Global var As String
Global fin As Integer
Global x As Integer
Global a As Integer
Global b As Integer
Global max As Integer
Global model As String
Global datedeb As String
Global datefin As String
Global dtdeb As String
Global dtfin As String
Global cat As String
Global avancement As Long
Global anmax As Integer
Sub recherche_variante()
DoCmd.OpenForm ("mo")
Erase liste
Dim rst As Recordset
Dim avancemt As Recordset
Dim n As Integer
DoCmd.SetWarnings False
Set avancemt = CurrentDb.OpenRecordset("select max(avance) as av from avancem")
avancement = (avancemt!av)
'On récupère la 1ere variante de la base
SQL_LIGNE = "SELECT * FROM recherche where var<>''"
Set rst = CurrentDb.OpenRecordset(SQL_LIGNE)
rst.MoveFirst
rst.Move (avancement)
'On se déplace dans le recordset pour récuperer les variantes une à une
Do
datedeb = ""
datefin = ""
var = ("rst!var")
model = ("rst!lib_cplt")
dtdeb = ""
dtfin = ""
cat = ("rst!num_cat")
If Not (rst!date_debut) Then
datedeb = (rst!date_debut)
End If
If Not (rst!date_fin) Then
datefin = (rst!date_fin)
End If
If Not (rst!aff_dtdeb) Then
dtdeb = (rst!aff_dtdeb)
End If
If Not (rst!aff_dtfin) Then
dtfin = (rst!aff_dtfin)
End If
Forms!mo!texte0 = model
Forms!mo![date_debut] = datedeb
Forms!mo![date_fin] = datefin
Forms!mo![aff_dtdeb] = dtdeb
Forms!mo![aff_dtfin] = dtfin
Dim rst2 As Recordset |
Partager