INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

embed chart into email body

embed chart into email body

(OP)
I have a form that is emailed to management detailing my days activities.  I wrote some code so data is pulled from the form and written to the body of the email so opening the file is not required.  I also have a chart that I would like to insert into the body of the email, but the coding escapes my simple mind.  The chart is located on a report named "rptProductionConstraintsForEmail".  Does anyone have a solution to this problem?

Private Sub E_MAIL_Click()
On Error GoTo Err_E_MAIL_Click

    Dim rsEmails As Recordset
    Dim strEmails As String
    
    
    'select the current record and send the report that is based on that record.
    DoCmd.RunCommand acCmdSelectRecord
    strText = "Date: " & Me.DATE & Chr$(13) & "Shift: " & Me.Shift & Chr$(13) & Chr$(13)
    strText = strText & "Feed Rate: " & Me.FeedRate & Chr$(13) & Chr$(13)
    strText = strText & "Slop Feed Rate: " & Me.SlopFeedRate & Chr$(13) & Chr$(13)
    strText = strText & "Incoming Rate: " & Me.IncomingRate & Chr$(13) & Chr$(13)
    strText = strText & "Y-Grade Inventory: " & Me.YGradeInventory & Chr$(13) & Chr$(13)
    strText = strText & "Slop Feed Inventory: " & Me.SlopInventory & Chr$(13) & Chr$(13)
    strText = strText & "Primary Constraint: " & Me.ProductionConstraint1 & Chr$(13) & Chr$(13)
    strText = strText & "Secondary Constraint: " & Me.ProductionConstraint2 & Chr$(13) & Chr$(13)
    strText = strText & "Equipment Issues: " & Me.EquipmentIssues & Chr$(13) & Chr$(13)
    strText = strText & "Quality Issues: " & Me.ProductQualityIssues & Chr$(13) & Chr$(13)
    strText = strText & "Storage Issues: " & Me.StorageFieldIssues & Chr$(13) & Chr$(13)
    strText = strText & "Pipeline Issues: " & Me.PipelineIssues & Chr$(13) & Chr$(13)
    strText = strText & "Comments: " & Me.COMMENTS
    
    Set db = CurrentDb()
    Set rsEmails = db.OpenRecordset("select * from tblConstraintEmailAddresses", dbOpenDynaset, dbReadOnly)
    rsEmails.MoveFirst
    
    Do Until rsEmails.EOF
        If rsEmails.Fields(0) <> "" Then
            strEmails = strEmails & rsEmails.Fields(0) & ";"
        End If
        rsEmails.MoveNext
    Loop
    
    DoCmd.SendObject acSendReport, "rptProductionConstraintsForEmail", acFormatSNP, strEmails, , , "Bushton Frac Production Constraints - " & Me.Shift & " Shift " & Me.DATE, strText

Exit_E_MAIL_Click:
    Exit Sub

Err_E_MAIL_Click:
    MsgBox Err.Description
    Resume Exit_E_MAIL_Click

Thanks for any help,

Jeff M.
 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close