I am working on a batabase and I want it to E-Mail the right person when fields are changed. I have a code in place that will notify all if form is updated but I do not want everyone to get E-Mails that do not pertain to them.
I am working on a batabase and I want it to E-Mail the right person when fields are changed. I have a code in place that will notify all if form is updated but I do not want everyone to get E-Mails that do not pertain to them.
You will have to somehow filter the email list with criteria to exclude irrelevant addresses. We have no idea what makes a person the 'right' person. Also don't know how you are sending notices.
Not enough information about your project for specific guidance. Provide more info about your issue and even attach the db 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.
This is what I have now but I would like to add the description and als where is says Case Else I want to send to all 3.
Private Sub Form_AfterUpdate()
Dim SendTo As String
Dim Body As String
Dim Subject As String
Dim Partno As String
Dim Descript As String
Dim Dispo As String
Partno = Combo49
Descript = Description
Dispo = Disposition
Select Case [Buyer Code]
Case Is = "03"
SendTo = "Sam.Kong@Vacon.com"
Case Is = "04"
SendTo = "Cynthia.Burkett@Vacon.com"
Case Is = "05"
SendTo = "Rod.Snider@Vacon.com"
Case Is = "06"
SendTo = "Cynthia.Burkett@Vacon.com"
Case Is = "08"
SendTo = "Patty.Culbertson@Vacon.com"
Case Is = "09"
SendTo = "Patty.Culbertson@Vacon.com"
Case Is = "11"
SendTo = "Patty.Culbertson@Vacon.com"
Case Else
SendTo = "Sam.Kong@Vacon.com""Patty.Culbertson@Vacon.com""Cy nthia.Burkett@Vacon.com"
End Select
Subject = "Notification of Nonconformance for Part #" & Partno
Body = "Part #" & Partno & "Part has been entered due to nonconformance."
DoCmd.SendObject acSendNoObject, , , SendTo, , , Subject, Body
End Sub
You want Description included where - in the Body? Just concatenate it into the string. What is als?
The SendTo must be a single text string:
"Sam.Kong@Vacon.com;Patty.Culbertson@Vacon.com;Cyn thia.Burkett@Vacon.com"
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.
Subject = "Notification of Nonconformance for Part #" & Partno
Body = "Part #" & Partno & "Part has been entered due to nonconformance." "Discrep"
DoCmd.SendObject acSendNoObject, , , SendTo, , , Subject, Body
End Sub
I want to add the discrepancy to the body
You must concantenate with ampersand (&) just as you did with Partno.
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.
But I want it to be a second line . I want it to say bla bla bla part entered then the second line to state the discrepancy
Discrepancy or Description? I don't see a variable Discrep.
Might be able to force carriage return line feed with:
Body = "Part #" & Partno & "Part has been entered due to nonconformance." & vbCRLF & Descript
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.
That worked great. Thanks alot for you time and help.