1 2 3 4 5 6 7 8 9 10 11 12 13 14
| For nbLot = 1 To nbLot - 1
For nbLigLot = 1 To nbLigLot + 1
'sqlCandidat = "SELECT Tbl_Registre_Depot.Numero_Depot, Tbl_Entreprise2.Denomination_Entreprise, Tbl_Entreprise2.Adresse_Entreprise, Tbl_Entreprise2.Code_Postal_Entreprise, Tbl_Entreprise2.Ville_Entreprise, Tbl_Registre_Depot.ID_Marche, Tbl_Registre_Depot.ID_Entreprise, Tbl_Registre_Depot.Lot_Depot FROM Tbl_Entreprise2 INNER JOIN Tbl_Registre_Depot ON Tbl_Entreprise2.ID_Entreprise = Tbl_Registre_Depot.ID_Entreprise WHERE Tbl_Registre_Depot.ID_Marche=34 AND Tbl_Registre_Depot.Lot_Depot=" & nbLot & " ORDER BY Tbl_Registre_Depot.Numero_Depot"
sqlCandidat = "SELECT Tbl_Registre_Depot.Numero_Depot, Tbl_Entreprise2.Denomination_Entreprise, Tbl_Entreprise2.Adresse_Entreprise, Tbl_Entreprise2.Code_Postal_Entreprise, Tbl_Entreprise2.Ville_Entreprise, Tbl_Registre_Depot.ID_Marche, Tbl_Registre_Depot.ID_Entreprise, Tbl_Registre_Depot.Lot_Depot FROM Tbl_Entreprise2 INNER JOIN Tbl_Registre_Depot ON Tbl_Entreprise2.ID_Entreprise = Tbl_Registre_Depot.ID_Entreprise WHERE Tbl_Registre_Depot.ID_Marche = 34 And Tbl_Registre_Depot.Lot_Depot =" & nbLot & " ORDER BY Tbl_Registre_Depot.Numero_Depot"
Set dbCandidat = CurrentDb
Set rsCandidat = dbCandidat.OpenRecordset(sqlCandidat)
ActiveDocument.Tables(nbLot).Cell(nbLigLot + 1, 1).Range.Text = rsCandidat.Fields("Numero_Depot")
ActiveDocument.Tables(nbLot).Cell(nbLigLot + 1, 2).Range.Text = rsCandidat.Fields("Denomination_Entreprise") & vbCrLf & rsCandidat.Fields("Adresse_Entreprise") & vbCrLf & rsCandidat.Fields("Code_Postal_Entreprise") & " " & rsCandidat.Fields("Ville_Entreprise")
rsCandidat.Close
Set rsCandidat = Nothing
dbCandidat.Close
Set dbCandidat = Nothing
Next nbLigLot
Next nbLot |
Partager