Hi,
I've written the following code to grab information on the open form in access and put it into an email with a snapshot attachment. This works fine but when I click the send button on the email it doesn't do anything. The only way to get it to work is to save the email, open it again and then press send.
I'm using Office 2000 pro with Outlook 2003. Both are patched pretty much up to date.
------------------------------------------------------------
Private Sub Command80_Click()
On Error GoTo Err_Command80_Click
Dim Title As Object
Dim Surname As Object
Dim ID As Object
Dim DesDate As Object
Dim RetOrRep As Object
Dim Item As Object
Dim Reason As Object
Dim Note As Object
Set Title = [Forms]![FormName]![Title]
Set Surname = [Forms]![FormName]![Surname]
Set ID = [Forms]![FormName]![ID]
Set DesDate = [Forms]![FormName]![SubFormName].Form![DespatchDate]
Set RetOrRep = [Forms]![FormName]![SubFormName].Form![Returned or Replaced?]
Set Item = [Forms]![FormName]![SubFormName].Form![WhichProduct?]
Set Reason = [Forms]![FormName]![SubFormName].Form![Fault]
Set Note = [Forms]![FormName]![SubFormName].Form![Notes]
DoCmd.SendObject acSendReport, "ProductReturnReport", "SnapshotFormat(*.snp)", "me@company.com", , , Title & " " & Surname & " cn " & ID & " dd " & DesDate & " " & StrConv(RetOrRep, vbUpperCase) & " " & Item & " " & StrConv(Reason, vbUpperCase), Note, True
Set Title = Nothing
Set Surname = Nothing
Set ID = Nothing
Set DesDate = Nothing
Set RetOrRep = Nothing
Set Item = Nothing
Set Reason = Nothing
Set Note = Nothing
Exit_Command80_Click:
Exit Sub
Err_Command80_Click:
MsgBox err.Description
Resume Exit_Command80_Click
End Sub
------------------------------------------------------------
Any suggestions as to why it wont send are welcome.
Thanks
I've written the following code to grab information on the open form in access and put it into an email with a snapshot attachment. This works fine but when I click the send button on the email it doesn't do anything. The only way to get it to work is to save the email, open it again and then press send.
I'm using Office 2000 pro with Outlook 2003. Both are patched pretty much up to date.
------------------------------------------------------------
Private Sub Command80_Click()
On Error GoTo Err_Command80_Click
Dim Title As Object
Dim Surname As Object
Dim ID As Object
Dim DesDate As Object
Dim RetOrRep As Object
Dim Item As Object
Dim Reason As Object
Dim Note As Object
Set Title = [Forms]![FormName]![Title]
Set Surname = [Forms]![FormName]![Surname]
Set ID = [Forms]![FormName]![ID]
Set DesDate = [Forms]![FormName]![SubFormName].Form![DespatchDate]
Set RetOrRep = [Forms]![FormName]![SubFormName].Form![Returned or Replaced?]
Set Item = [Forms]![FormName]![SubFormName].Form![WhichProduct?]
Set Reason = [Forms]![FormName]![SubFormName].Form![Fault]
Set Note = [Forms]![FormName]![SubFormName].Form![Notes]
DoCmd.SendObject acSendReport, "ProductReturnReport", "SnapshotFormat(*.snp)", "me@company.com", , , Title & " " & Surname & " cn " & ID & " dd " & DesDate & " " & StrConv(RetOrRep, vbUpperCase) & " " & Item & " " & StrConv(Reason, vbUpperCase), Note, True
Set Title = Nothing
Set Surname = Nothing
Set ID = Nothing
Set DesDate = Nothing
Set RetOrRep = Nothing
Set Item = Nothing
Set Reason = Nothing
Set Note = Nothing
Exit_Command80_Click:
Exit Sub
Err_Command80_Click:
MsgBox err.Description
Resume Exit_Command80_Click
End Sub
------------------------------------------------------------
Any suggestions as to why it wont send are welcome.
Thanks