Bonjour,
J'essaye de faire une boucle sur une liste déroulante provenant d'un formulaire
Mon code est le suivant :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 Sub GammePDF() Dim i As Integer Dim Max As Integer Max = Forms![F_Preventif]![lstmachine].ListCount - 1 'nombre d'enregistrements For i = 0 To Max Dim Ladate As Date, Lentier As Variant Dim mach As String, Lig As String Ladate = Forms![F_Preventif]![Date_p] Lentier = Format(DateSerial(Year(Ladate), Month(Ladate), Day(Ladate)), "dd-mm-yy") mach = Forms![F_Preventif]![lstmachine] Lig = Forms![F_Preventif]![lstligne] DoCmd.OutputTo acOutputReport, "PRINCIPALE", acFormatPDF, "\\fermat\echange\Entretien_r01\Méthodes Maintenance\Gammes\" & "Gamme_" & Lig & "_" & mach & "_" & Lentier & ".pdf" Next i End Sub
Je souhaite savoir comment on indique que c'est la i'ème ligne de ma liste déroulante "Forms![F_Preventif]![lstmachine]"
Merci infiniment
Othmane
Partager