nice! So just add that statement at the end of the script?
nice! So just add that statement at the end of the script?
hmm...must be doing something wrong. Seems to have ignored that statement completely.
At the end of what script? Certainly not after the send email code. And you of course must use your names, not the dummy aliases I used. Post the entire procedure code for analysis.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Private Sub Command20_Click()
Dim mess_body As String
Dim appOutLook As Outlook.Application
Dim MailOutLook As Outlook.MailItem
Set appOutLook = CreateObject("Outlook.Application")
Set MailOutLook = appOutLook.CreateItem(olMailItem)
Set appOutLook = CreateObject("Outlook.Application")
Set MailOutLook = appOutLook.CreateItem(olMailItem)
With MailOutLook
.BodyFormat = olFormatRichText
.To = Me.To_Address
.CC = Me.CC_Address
.Subject = Me.Mess_Subject
.HTMLBody = Me.Text65 & Me.Text65 & Me.Combo71 & Me.Text73 & Me.Text67 & Me.Combo101 & Me.Mess_Text & Me.Text121 & Me.Text84 & _
If Left(Me.Mail_Attachment_Path, 1) <> "<" Then
.Attachments.Add (Me.Mail_Attachment_Path)
If IsNull(Text65) Or IsNull(Combo71) Then MsgBox "Missing SC Ticket # and/or IMAC Code."
Else
'Send email
End If
'.DeleteAfterSubmit = True 'This would let Outlook send th note without storing it in your sent bin
.Send
End With
'MsgBox MailOutLook.Body
Exit Sub
email_error:
MsgBox "An error was encountered." & vbCrLf & "The error message is: " & Err.Description
Resume Error_out
Error_out:
End Sub
If IsNull(Text65) Or IsNull(Combo71) Then
MsgBox "Missing SC Ticket # and/or IMAC Code."
Else
'Send email
'.DeleteAfterSubmit = True 'This would let Outlook send the note without storing it in your sent bin
.Send
End If
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
hmm...still ignores it for some reason.
disregard... I got it! I needed another End If statement. Thanks again June7
I see that now. Running the procedure shouldn't have just ignored the code, should give a runtime error. Always Debug>Compile after code edits. The compile would have failed.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.