+ Reply to Thread
Results 1 to 1 of 1

Sendobject Help

  1. #1
    Registered User
    Join Date

    Sendobject Help

    Good Afternoon, Could someone please help the code list below works with one failing.
    THe code loops through a list "Contractors With Jobs Not Atteded On Time" sending a report "Jobs Not Achieving Attended On Time" to the relevant email address this works perfectly attaching the correct report but not the filename is incorrect.

    Please anyone help???

    Private Sub Command134_Click()
    Dim MyDb As DAO.Database
    Dim rsEmail As DAO.Recordset
    Dim sToName As String
    Dim sSubject As String
    Dim sMessageBody As String

    Set MyDb = CurrentDb()
    Set rsEmail = MyDb.OpenRecordset("Contractors With Jobs Not Atteded On Time", dbOpenSnapshot)

    Do Until rsEmail.EOF
    Me.Combo130 = rsEmail!Contractor
    sToName = rsEmail!Email
    sSubject = "Jobs Not Achieving Attended On Time " & rsEmail!Email
    sMessageBody = "Please Find Attached Jobs Not Achieving Attended On Time " & rsEmail!Contractor

    Const cTIME = 1500 'in MilliSeconds
    Call sSleep(cTIME)

    DoCmd.SendObject acSendReport, "Jobs Not Achieving Attended On Time", acFormatRTF, sToName, , , sSubject, sMessageBody, False, False


    Set MyDb = Nothing
    Set rsEmail = Nothing
    End Sub
    Last edited by Rikuk; 09-02-2009 at 10:28 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1