Send Object function failure

P

Peter Hibbs

Access 2000, Windows XP

On this database I have the following code :-

Private Sub btnEMail_Click()

Dim vMessage As String

On Error GoTo ErrorCode

vMessage = "Default Subject"
DoCmd.SendObject acSendNoObject, , , EMailAddress, , , vMessage, ,
True
Exit Sub

ErrorCode:
If Err = 2501 Then Exit Sub Beep
MsgBox "Error Code " & Err & "; " & Error

End Sub

EMailAddress is a field which contains a valid email address. I am
using MS Outlook as my email program and everything works fine, I can
send multiple emails, etc.

My client is using Windows Live Mail (which apparently is what
supersedes Outlook Express now). When he clicks the button for the
FIRST time it works fine, the email is displayed on screen and he can
send it as normal. However, if he tries to send another email either
for the same record or another one, nothing happens, no error messages
and the code continues as if the function did not exist. Obviously he
can send emails normally so his system seems to be working OK.

If he closes down the database and runs it again the same thing
happens, he can send one email and then nothing for any subsequent
attempts.

I have established that the SendObject command executes by placing a
break point on that line. Does anyone have any ideas why this should
happen or what I can do to fix the problem.

TIA

Peter Hibbs.
 

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