Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

email crashed database 1

Status
Not open for further replies.

integritycare

Technical User
Mar 12, 2011
151
AU
Hi all,
I am using this code on an access form to email an access report. Outlook opens with the attachment, but then crashes the database;

Code:
Private Sub cmdMail_Click()

Dim stDocName As String

    If Me.Dirty Then
        DoCmd.RunCommand acCmdSaveRecord
        Else
    End If
    
    stDocName = "LEAVE APPLICATION"
    DoCmd.SendObject acReport, stDocName, acFormatRTF, , _
    , , , , True, False
    
Exit Sub

End Sub

How can I prevent this. reading the forums people seem to be using CreateObject directly into Outlook.
If this will stop this crashing how is this done.

Thank you
Integrity
 
Hi MazeWorx,
Thank you for your reply. I have read this and will give it a go. I might have to post a few enquries here if I can't get it to work
 
its pretty easy to implement. There is a block of code to paste into a module in Outlook and rest into your db editing the recipients as required. I use it in an app that runs an import/Sync process then notifies users with an automated email works like a charm

HTH << MaZeWorX >> "I have not failed I have only found ten thousand ways that don't work
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top