Sending an Object in Outlook

J

Jay

I have created a form that sends an e-mail after it has
been saved. Access will allow me to send the form once but
when I try to send it again on another record it does not
allow me to do this. Any suggestions as to why?
 
G

Guest

I don't get an error message it just skips over that line
of code. Here is my coding:
Select Case Me!Level
Case 1
GoTo FirstLine
Case 2
GoTo FirstLine
Case 3
GoTo FirstLine
Case 4
GoTo FirstLine
Case 5
GoTo FirstLine
Case 6
GoTo FirstLine
Case 7
Me.Label207.Caption = "HR Approved!"
Me.Label207.BackColor = 65280
Me.Label207.ForeColor = 0
Me.HRApproved = 1
DoCmd.RunCommand acCmdSaveRecord
MsgBox "Your Corrective Action has been saved!" & vbCrLf
& "You may issue this CA because it is a Verbal!" & vbCrLf
& "", vbInformation + vbOKOnly
GoTo LastLine
End Select
FirstLine:
Me.Label207.Caption = "Needs HR Approval!"
Me.Label207.BackColor = 255
Me.Label207.ForeColor = 16777215
Me.HRApproved = 0
DoCmd.RunCommand acCmdSaveRecord
MsgBox "Your Corrective Action has been saved!" & vbCrLf
& "However Do not issue until HR Approves!" & vbCrLf
& "Press OK and wait about 5-15 seconds as an e-mail is
being prepared for HR.", vbInformation + vbOKOnly
DoCmd.SendObject
acSendNoObject, , , "(e-mail address removed)", , , "Correctiv
e Action Waiting for Approval", "A corrective action has
been issued for" & " " & [First Name] & " " & [Last Name]
& " " & "by" & " " & [Supervisor] & " " & "on" & " " &
[Date Issued] & " " & "it was for:" & vbCrLf
& " " & [Type of] & " " & "at a"
& " " & [Level of] & "" & "." & vbCrLf & "Thanks," &
vbCrLf & "" & [Supervisor]
GoTo LastLine
LastLine:
Select Case Me![Type]
Case 3
MsgBox "You must complete a PIP!", vbOKOnly, "PIP NEEDED"
DoCmd.OpenForm "PIP", acNormal, , , acFormAdd,
acWindowNormal
DoCmd.Close acForm, "Corrective Action Entry", acSaveNo
Case Else
DoCmd.RunCommand acCmdRefresh
Response = MsgBox("Would you like to create another
Corrective Action?", vbQuestion + vbYesNo, "ADD ANOTHER")
If Response = vbYes Then
DoCmd.RunCommand acCmdRecordsGoToNew
Set SendObject = Nothing
End If
If Response = vbNo Then
DoCmd.Close acForm, "Corrective Action Entry", acSaveNo
End If
End Select
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top