Codul pentru butonul de mail este :
Cod: Selectaţi tot
Private Sub Command29_Click()
Dim strDocName As String
Dim strWhere As String
strDocName = "OrdinPlata"
strWhere = "[IDOrder]=" & Me!IDOrder
DoCmd.OpenReport strDocName, acPreview, , strWhere
DoCmd.OutputTo acOutputReport, "OrdinPlata", acFormatPDF, _
"D:\" & "OP " & Me!IDOrder & ".PDF"
If Application.CurrentProject.AllReports(ComenziLaFurnizori).IsLoaded = True Then
DoCmd.Close acReport, "OrdinPata"
End If
DoCmd.OpenForm "SendMail", , , , acNormal, adDialog
Forms![SendMail].Form![Atasament] = "D:\" & "OP " & Me!IDOrder & ".PDF"
Forms![SendMail].Form![Subiect] = "OP Nr " & Me!IDOrder
Forms![SendMail].Form![txtGmailTo] = Me!Email
Forms![SendMail].Form![Mesaj] = "OP Nr " & Me!IDOrder
End Sub