I am using a button to send an email and have the problem when closing the email rather than sending.
I cannot seem to figure out other code examples found so hoped that by showing my modest code might persuade someone to offer me a little assistance.
Thanks in advance.
Private Sub emailcertcmd_Click()
Dim dbs As Database, customers As Recordset, certemail As Variant, stDocName As String
Set dbs = CurrentDb
stDocName = "Main Certificateemail"
Set cust = dbs.OpenRecordset("customers", dbOpenDynaset)
On Error Resume Next
Do Until cust.EOF
If Me.Accno = cust![Account No] Then
certemail = cust![certemail]
DoCmd.SendObject acSendReport, "Main Certificateemail", acFormatPDF, certemail, , , "Your Freightnet (RASCO) Ltd REST Certificate is attached", "Please find your Certificate attached", True
DoCmd.RunMacro ("main printcert")
Set db = Nothing