I'm completing a theatre attendance tracking database. The user has a requirement to send via e-mail the flyers advertising each performance. The database contains e-mail addresses. What is the best way to accomplish?
here is some psuedo code...
...
lcSubject = "WebSeries Daily Alert: " & rsReports("REPORT_Name" & " Value Date " & ldTemp
lcObjectName = lcQueryName
'E-Mail Report
llCheck = SendEMailOut(lcEMailAddress, lcSubject, lcMessage, lcObjectType, lcObjectName, lcFormatType)
If llCheck = False Then
MsgBox ("Error Sending Emails"
Else
lcComment = "Prior Day Payments Summary EMail Sent to " & lcEMailAddress
lcSQLLog = "INSERT INTO tbl_Log (REPORT_TIME,QUERY_NAME,RECORD_COUNT,COMMENTS) "
lcSQLLog = lcSQLLog & "VALUES ('" & lcTime & "','" & lcObjectName & "'," & rs.RecordCount & ",'" & lcComment & "')"
ThisDB.Execute lcSQLLog, dbFailOnError
End If
...
lcMessageText2 = lcMessageText2 & "Note: Failure to Contact IT Help Desk Within a Reasonable Time May Result in WebSeries Account Suspension." & vbCr
llTestCall = SendEMailOut2(rs("EMAILAddress", lcSubject2, lcMessageText2)
If llTestCall = True Then
'write to log
Else
'msgbox?
End if
...
Public Function SendEMailOut2(lcEM, lcSUBJ, lcMess)
On Error GoTo Err_SendEMailOut2
DoCmd.SendObject acSendNoObject, "", acFormatTXT, lcEM, , , lcSUBJ, lcMess, False
SendEMailOut2 = True
Exit_SendEMailOut2:
Exit Function
Err_SendEMailOut2:
SendEMailOut2 = False
MsgBox Err.DESCRIPTION
Resume Exit_SendEMailOut2
End Function
...
Public Function SendEMailOut(lcEM, lcSUBJ, lcMess, lcObjType, lcObjName, lcFormat) As Boolean
On Error GoTo Err_SendEMailOut
DoCmd.SendObject acSendQuery, lcObjName, acFormatXLS, lcEM, , , lcSUBJ, lcMess, False
SendEMailOut = True
Exit_SendEMailOut:
Exit Function
Err_SendEMailOut:
SendEMailOut = False
MsgBox Err.DESCRIPTION
Resume Exit_SendEMailOut
End Function
Steve Medvid
"IT Consultant & Web Master"
e-Mail: Stephen_Medvid@GMACM.com
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.