SIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
FUNZIONA, GRAZIE A TUTTIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII - SIETE FAVOLOSI
ECCO IL CODICE FUNZIONANTE, PULITO PULITO:
Private Sub Creazione_Click()
Dim db As DAO.Database
Dim rst1 As DAO.Recordset
Dim strPath As String
Set db = CurrentDb
Set rst1 = db.OpenRecordset("DATABASE", dbOpenDynaset)
rst1.MoveFirst
Do Until rst1.EOF
strPath = "C:\Users\Famiglia\Desktop\Mandati\" & rst1![id] & "-" & rst1![COGNOME] & ".PDF"
DoCmd.OpenReport "Mandato", acViewPreview, , "[ID] = " & rst1![id], acHidden
DoCmd.OutputTo acOutputReport, "Mandato", acFormatPDF, strPath, False
DoCmd.Close acReport, "Mandato"
rst1.MoveNext
Loop
rst1.Close
db.Close
End Sub