Email Lotus Notes 5.0.9a from Access 2003 on Windows XP

T

tlieser

Hello, I have a customer form to make requests to my organization, and am
using the following code to send an email to me to notify me that a new
request has been made, and is ready for review. The email code worked fine
on Access 2002, but I recently upgraded to 2003, and now the code works
intermittently. I can't figure out why the code works sometimes, and
sometimes not.

Any help would be greatly appreciated,
Tim Lieser
Private Sub cmd_save_request_Click()
On Error GoTo Err_cmd_save_request_Click


'DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

Dim strAddressee As String
Dim strSubject As String
Dim strBody As String
Dim objNotesWS As Object
Dim notesdb As Object

Set objNotesWS = CreateObject("Notes.NotesUIWorkspace")
Set notesdb = objNotesWS.COMPOSEDOCUMENT(, , "memo")

strAddressee = "[email protected]"
strSubject = "MIS Work Request Number " & Me.[RequestID] & " is
submitted for your review."
strBody = "The following request was received on " & Me.[RequestDate] &
" from " & Me.Requestor

notesdb.FIELDSETTEXT "EnterSendTo", strAddressee
'notesdb.FIELDSETTEXT "SendTo", strAddressee
notesdb.FIELDSETTEXT "Subject", strSubject
notesdb.FIELDSETTEXT "Body", strBody

notesdb.Send
notesdb.close

Set notesdb = Nothing
Set objNotesWS = Nothing

MsgBox "Thank you. Your request has been submitted to MIS for review."

DoCmd.close

Exit_cmd_save_request_Click:
Exit Sub

Err_cmd_save_request_Click:
MsgBox Err.Description
Resume Exit_cmd_save_request_Click

End Sub
 
Top