davlas,
Okay I have a form "FA Request". Once data is submitted a report "Failure Analysis Report" appears containing the data. I have written a bunch of code to send the data in an email but it only works with Outlook. This is not sent as an attachment just as text in an email.
Here is a copy of the code:
===============================================================
stDocName = "Failure Analysis Report"
mytext = "Your request has been submitted." + Chr(13) + Chr(10)
mytext = mytext + "TRN:" + [TRN] + Chr(13) + Chr(10)
mytext = mytext + "NPIE:" + [NPIE] + Chr(13) + Chr(10)
mytext = mytext + "p/n:" + [p/n] + Chr(13) + Chr(10)
mytext = mytext + "Vendor:" + [Vendor] + Chr(13) + Chr(10)
mytext = mytext + "Vendor p/n:" + [Vendor p/n] + Chr(13) + Chr(10)
mytext = mytext + "Base Number:" + [Base Number] + Chr(13) + Chr(10)
mytext = mytext + "Serial Number:" + [Serial Number] + Chr(13) + Chr(10)
mytext = mytext + "Reference Designator:" + [Reference Designator] + Chr(13) + Chr(10)
mytext = mytext + "Instance:" + [Instance] + Chr(13) + Chr(10)
mytext = mytext + "Proto Number:" + [Proto Number] + Chr(13) + Chr(10)
mytext = mytext + "Lot Code:" + [Lot Code] + Chr(13) + Chr(10)
mytext = mytext + "Date Code:" + [Date Code] + Chr(13) + Chr(10)
mytext = mytext + "Area:" + [Area] + Chr(13) + Chr(10)
mytext = mytext + "OS:" + [OS] + Chr(13) + Chr(10)
mytext = mytext + "Latent Days:" + [Latent Days] + Chr(13) + Chr(10)
mytext = mytext + "Classcode:" + [Classcodes] + Chr(13) + Chr(10)
mytext = mytext + "Commodity:" + [Commodity] + Chr(13) + Chr(10)
CreateDate = Me![Case Creation].Value
mytext = mytext + "Case Creation Date:" + CreateDate + Chr(13) + Chr(10)
FailDate = Me![Date of Failure].Value
mytext = mytext + "Date of Failure:" + FailDate + Chr(13) + Chr(10)
Rem ExpectedClosure = Me![Expected Closure].Value
Rem mytext = mytext + "Expected Closure Date:" + ExpectedClosure + Chr(13) + Chr(10)
mytext = mytext + "Comments:" + [Comments] + Chr(13) + Chr(10)
mytext = mytext + "Failure Dump:" + [Failure Dump] + Chr(13) + Chr(10)
MsgBox mytext
Me.Refresh
DoCmd.SendObject acSendNoObject, , acFormatTXT, [NPIE] + "@company.com", "fa@company.com" + "," +
, , "Failure Analysis Request-" + [p/n], mytext, False
DoCmd.OpenReport stDocName, acPreview, , "[TRN]= '" & Me!TRN & "'"
DoCmd.Close acForm, "FA Request"
=============================================================
I am trying to implement your suggestion, since it sounds like it will use the default email to send the message.
Here is what I have so far:
=============================================================
DoCmd.SendObject acSendReport, Report_FailureAnalysisRequest, acFormatTXT, [NPIE] + "@company.com", "fa@company.com" + "," + [email], , "Failure Analysis Request-" + [p/n], mytext, No
=============================================================
What am I missing? =)
Thanks for your help,
Christina