E-mail has been sent

sdawson

Registered User.
Local time
Today, 19:48
Joined
Apr 22, 2003
Messages
165
I've a problem in that I can send an e-mail (and .rtf attachment) only once each time I open Access (2000).
I get "E-mail has been sent" message box when trying to send more than one.
Code behind command button is:-

Dim stDocName As String
Dim stremail As String

stDocName = "email report"
stremail = Reports![email report]![emailaddress]

DoCmd.OpenReport stDocName, acViewPreview, , "[ID]=" & Forms![Data3]![ID]

DoCmd.SendObject acReport, stDocName, "RichTextFormat(*.rtf)", , "my e-mail address.co.uk", , "Subject", "Message", True

MsgBox "E-Mail has been sent"

DoCmd.Close

Is this a "feature" of Access 2000 or is my code faulty.
Any treads would be useful.

Ta
 
sdawson said:
Dim stDocName As String
Dim stremail As String

stDocName = "email report"
stremail = Reports![email report]![emailaddress]

DoCmd.OpenReport stDocName, acViewPreview, , "[ID]=" & Forms![Data3]![ID]

DoCmd.SendObject acReport, stDocName, "RichTextFormat(*.rtf)", , "my e-mail address.co.uk", , "Subject", "Message", True

MsgBox "E-Mail has been sent"

DoCmd.Close acForm, Me.Name ' e.g. try to specify what you want to close

I don't use Access 2000 so I don't know of the proble. I made a comment on your code.

The best thing to do is search for posts on email - most notably by BukHix and Hayley Baxter.
 
And change this line:

Code:
stDocName = "email report"

to:

Code:
stDocName = "[email report]"
 
Tried both of these (and other variations) and still no joy.
I'll follow up the other threads.

Ta
 

Users who are viewing this thread

Back
Top Bottom