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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Send Object Method 1

Status
Not open for further replies.

oldwen

Programmer
Dec 2, 2003
23
US
Hello all. I am experiencing trouble with the send object method in MS Access. I get and error message that I was unable to send the message. My code compiles without error. Maybe there is a reference that I am missing or something. Any advice would be appreciated.

Code:

Private Sub cmdSubmitRequest_Click()
On Error GoTo Err_cmdSubmitRequest_Click

Dim sendto As String, pm As String, strsubject As String
sendto = "oldwen@yahoo.com"
pm = "oldwen@yahoo.com"
strsubject = "This is a test"

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.SendObject acSendNoObject, , , sendto, , , strsubject, strsubject, , False

Exit_cmdSubmitRequest_Click:
Exit Sub

Err_cmdSubmitRequest_Click:
MsgBox Err.Description
Resume Exit_cmdSubmitRequest_Click

End Sub
 
What about replacing this:
DoCmd.SendObject acSendNoObject, , , sendto, , , strsubject, strsubject, , False
By this ?
DoCmd.SendObject acSendNoObject, , , sendto, , , strsubject, strsubject, False

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Yes, that did the trick. Can you maybe break this down for me. Why does this allow you to send the message?
 
From my object browser:
Sub SendObject([ObjectType As AcSendObjectType = acSendNoObject], [ObjectName], [OutputFormat], [To], [Cc], [Bcc], [Subject], [MessageText], [EditMessage], [TemplateFile])
So in your original post the 'False' argument was for TemplateFile and not for EditMessage.

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top