hi , this is the code that I use to send an e-mail
but I think because there is no e-mail address in the form I get the error
"invalid use of null"
what I would like it to say is
" please enter customer e-mail address in customer form"
any help apppricated
steve
but I think because there is no e-mail address in the form I get the error
"invalid use of null"
what I would like it to say is
" please enter customer e-mail address in customer form"
any help apppricated
steve
Code:
Private Sub cmdEmail_Click()
On Error GoTo Err_Handler
Dim strTo As String
Dim strSubject As String
Dim strMessageText As String
Me.Dirty = False
strTo = Me.[E-Mail address]
strSubject = "Invoice Number " & Me.Invoicenumber
strMessageText = Me.CustomerName & ":" & _
vbNewLine & vbNewLine & _
"Your latest invoice is attached." & _
vbNewLine & vbNewLine & _
"Customer Accounts Department, Widget Supply Company"
DoCmd.SendObject ObjectType:=acSendReport, _
ObjectName:="Invoice report", _
OutputFormat:=acFormatPDF, _
To:=strTo, _
Subject:=strSubject, _
MESSAGETEXT:=strMessageText, _
EditMessage:=True
Exit_Here:
Exit Sub
Err_Handler:
MsgBox Err.Description
Resume Exit_Here
End Sub