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
| Private Sub Report_Activate()
Dim fichier As String
Dim base As Database: Dim requete As String
Dim client_msg As New Outlook.Application
Dim message As Outlook.MailItem
Dim adresse As String: Dim ligne As Recordset
fichier = Application.CurrentProject.Path & "\Archives_factures\facture_" & Com_num.Value & ".pdf"
DoCmd.OutputTo acOutputReport, , acFormatPDF, fichier, False
Set base = Application.CurrentDb
requete = "UPDATE Commandes SET Com_facture='facture_" & Com_num.Value & ".pdf'WHERE Com_num=" & Com_num.Value
base.Execute requete
Set ligne = base.OpenRecordset("SELECT mail FROM Clients WHERE Code_client=" & Code_Client.Value.dbOpenDynaset)
ligne.MoveFirst
adresse = ligne.Fields("mail").Value
ligne.Close
base.Clo
Set ligne = Nothing
Set base = Nothing
MsgBox adresse
End Sub |
Partager