I am using MSAccess 2000 SR1 and am trying to use sendObjects to send a preformatted report in HTML format as an attachment to an email message.
The first time I perform this function (by way of button on a form) it works perfectly.
When I next try to do it (for a different record or the same record) it simply fails to execute. No error message or anything.
I am currently working around this by closing down Access and restarting it (works fine for one more message).
My code appears below:
Expand|Select|Wrap|Line Numbers
- Private Sub Command38_Click()
- On Error GoTo Err_Command38_Click
- Dim recipient, copies As String
- Forms![Issue Status]![Customer].SetFocus
- recipient = Me![Customer].Text
- Forms![Issue Status]![InterestedParties].SetFocus
- copies = Me![InterestedParties].Text
- Dim subjecttext As String
- Dim IssueRef As String
- Dim DetailText As String
- Forms![Issue Status]![Description].SetFocus
- subjecttext = Me![Description].Text
- Forms![Issue Status]![Issue Reference].SetFocus
- IssueRef = Me![Issue Reference].Text
- Forms![Issue Status]![Details].SetFocus
- DetailText = Me![Details].Text
- DoCmd.SendObject acSendForm, "Issue Update All", acFormatHTML, _
- recipient, copies, , _
- "Issue Status Update: ( " & IssueRef & " ) " & subjecttext, "Detail: " & subjecttext & vbCrLf & DetailText & vbCrLf & vbCrLf & "Please find attached an update of this Issue", True
- Forms![Issue Status]![Command38].SetFocus
- Exit_Command38_Click:
- Exit Sub
- Err_Command38_Click:
- MsgBox Err.Description
- Resume Exit_Command38_Click
- End Sub