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?
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