special question for JWM, thanks

G

Guest

This work wonder full but if I want to send an attachment, where is it goes??


Following is a pretty simple send mail snippet. You can call it from a
command button OnClick event or from the field itself. The control
containing the email address in this instance is "txtEmailAddress."



this is my programming,,


Private Sub SendEmail_Click()
On Error GoTo Err_SendEmail_Click

Dim stDocName As String

If IsNull(CustomerID) Then
MsgBox "There is no e-mail address to send email to!", vbOKOnly, "Error"
CustomerID.SetFocus

Exit Sub

End If



stDocName = CustomerID.Column(2)


DoCmd.SendObject , , , stDocName

Exit_SendEmail_Click:
Exit Sub
Err_SendEmail_Click:
Select Case Err.Number
Case 0
Resume Next
Case Else
MsgBox Err.Number & ": " & Err.Description
End Select

Resume Exit_SendEmail_Click

End Sub
 
J

jwm

Assuming you wanted to send the results of a query as an attachment,
see the change below...

This work wonder full but if I want to send an attachment, where is it goes??


Following is a pretty simple send mail snippet. You can call it from a
command button OnClick event or from the field itself. The control
containing the email address in this instance is "txtEmailAddress."



this is my programming,,


Private Sub SendEmail_Click()
On Error GoTo Err_SendEmail_Click

Dim stDocName As String

If IsNull(CustomerID) Then
MsgBox "There is no e-mail address to send email to!", vbOKOnly, "Error"
CustomerID.SetFocus

Exit Sub

End If



stDocName = CustomerID.Column(2)

DoCmd.SendObject acSendQuery, "insert name of query here",
acFormatRTF, strToWhom, , , , strDocName, True
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top