S
SandySun
Hi, I am having a problem with a Dlookup. I am trying to set up an Auto
email and I need to insert a formated number field in the Body of the
email...and I just can't seem to figure it out....can someone please help?
This is what I have so far;
Function SendByEmail(strtest As String, strEmail As String) As Boolean
On Error GoTo PROC_ERR
Dim strRecipient As String
Dim strSubject As String
Dim strMessageBody As Integer
strRecipient = strEmail
strSubject = "Sales Data"
strMessageBody = "Prior Day Sales " & DLookup("amountround", "Sales",
"Messageno = 0")
DoCmd.SendObject acSendNoObject, , , strRecipient, , , strSubject,
strMessageBody, False
SendByEmail = True
PROC_EXIT:
Exit Function
PROC_ERR:
SendByEmail = False
If Err.Number = 2501 Then
Call MsgBox( _
"The email was not sent for " & strEmail & ".", _
vbOKOnly + vbExclamation + vbDefaultButton1, _
"User Cancelled Operation")
Else
MsgBox Err.Description
End If
Resume PROC_EXIT
End Function
email and I need to insert a formated number field in the Body of the
email...and I just can't seem to figure it out....can someone please help?
This is what I have so far;
Function SendByEmail(strtest As String, strEmail As String) As Boolean
On Error GoTo PROC_ERR
Dim strRecipient As String
Dim strSubject As String
Dim strMessageBody As Integer
strRecipient = strEmail
strSubject = "Sales Data"
strMessageBody = "Prior Day Sales " & DLookup("amountround", "Sales",
"Messageno = 0")
DoCmd.SendObject acSendNoObject, , , strRecipient, , , strSubject,
strMessageBody, False
SendByEmail = True
PROC_EXIT:
Exit Function
PROC_ERR:
SendByEmail = False
If Err.Number = 2501 Then
Call MsgBox( _
"The email was not sent for " & strEmail & ".", _
vbOKOnly + vbExclamation + vbDefaultButton1, _
"User Cancelled Operation")
Else
MsgBox Err.Description
End If
Resume PROC_EXIT
End Function