I am trying to email an Access Report with Visual Basic 6 but I am having troubles. Here is a sample code that I am trying to run, does anyone see any problems with it?
Private Sub Command1_Click()
mail_bug
End Sub
Function mail_bug()
On Error GoTo mail_bug_Err
Set A = CreateObject("Access.Application")
A.OpenCurrentDatabase ("S:\UV DISPATCH\brad\vb programs\new_invoices\2.0\invoice_data_031212.mdb")
A.DoCmd.SendObject acSendReport, "Reports_Invoices", "RichTextFormat(*.rtf)", "bwickwire@waggonerstrucking.com", , , "Comment Reports", "Testing1", False
mail_bug_Exit:
Exit Function
mail_bug_Err:
MsgBox Error$
Resume mail_bug_Exit
End Function