E-mail on an IF (1 Viewer)

Locopete99

Registered User.
Local time
Today, 12:52
Joined
Jul 11, 2016
Messages
163
Hi,

I'm trying to get my database to send a notification if the area assigned to meets a criteria. Other departments don't need an e-mail.

It doesn't seem to be working though.

Can someone take a look?

Code:
Public Sub SendLotusNotesMail(strMailTitle As String, strLotusNotesUserID As String, strTextBody As String, Optional strFileAttachment As String = "", Optional fSaveMailToTheSentFolder As Boolean = False)

Private Sub Label54_Click()
Dim objAttachment As Object
Dim objMailDb As Object
Dim objMailDocument As Object
Dim objEmbedObject As Object
Dim objNotesSession As Object

Dim strMailDbName As String



If Me.[Assigned To] = "Purchasing" Then


'Start objNotesSession in Lotus Notes
Set objNotesSession = CreateObject("Notes.NotesSession")

'Open the mail database in Lotus Notes
Set objMailDb = objNotesSession.GETDATABASE("", strMailDbName)
objMailDb.OPENMAIL

'Set up the new mail document
Set objMailDocument = objMailDb.CREATEDOCUMENT
objMailDocument.Form = "Memo"
objMailDocument.sendto = "XXXXXXXXX"
objMailDocument.Subject = Me.[Chase Type] & " " & Me.Part_Number & "  Enquiry Reference " & Me.Enquiry_Reference
objMailDocument.Body = "There is a new enquiry to look at"
DoCmd.RunCommand acCmdSaveRecord
MsgBox "Your request has been saved and assigned."
DoCmd.Close

Else
DoCmd.RunCommand acCmdSaveRecord
MsgBox "Your request has been saved and assigned."
DoCmd.Close
End If


End Sub
 

JHB

Have been here a while
Local time
Today, 21:52
Joined
Jun 17, 2012
Messages
7,732
You only create the E-mail, you don't sent it.
 

Locopete99

Registered User.
Local time
Today, 12:52
Joined
Jul 11, 2016
Messages
163
Thanks, I knew i was missing something!
 

Users who are viewing this thread

Top Bottom