I'm sure I'm close, but this isn't working. I have a table tblDEmailList which stores the [plant] and the [dEmailAddress].
When a rejeect is issued at the Fenton plant, an email need to go to the sister plants not to the plant who recieved one,
to check thier product line for the same condition. the Form frmEnterReadAcrossSummary has a command button which runs a module, the code is:
How would I write the if statement?? to skip the issuing plant.
Sub OpenDimensional()
Dim rsEmail As DAO.Recordset
Dim strEmail As String
Set rsEmail = CurrentDb.OpenRecordset("tblDEmailList") 'table where email is
strEmail = rsEmail.Fields("dEmailAddress").Value
rsEmail.MoveNext
Do While Not rsEmail.EOF
strEmail = strEmail & " ; " & rsEmail.Fields("dEmailAddress").Value
rsEmail.MoveNext
Loop
DoCmd.SendObject , , , strEmail, , , "PRR has been issued", "PR Number #" & " " & Forms!frmEnterReadAcrossSummary.PRRNumber & " " & "was entered into the system by" & " " & Forms!frmEnterReadAcrossSummary.Plant & " on" & " " & Format(Forms!frmEnterReadAcrossSummary.Date) & ". "
Set rsEmail = Nothing
MsgBox "Email notifications have been sent"
End Sub
When a rejeect is issued at the Fenton plant, an email need to go to the sister plants not to the plant who recieved one,
to check thier product line for the same condition. the Form frmEnterReadAcrossSummary has a command button which runs a module, the code is:
How would I write the if statement?? to skip the issuing plant.
Sub OpenDimensional()
Dim rsEmail As DAO.Recordset
Dim strEmail As String
Set rsEmail = CurrentDb.OpenRecordset("tblDEmailList") 'table where email is
strEmail = rsEmail.Fields("dEmailAddress").Value
rsEmail.MoveNext
Do While Not rsEmail.EOF
strEmail = strEmail & " ; " & rsEmail.Fields("dEmailAddress").Value
rsEmail.MoveNext
Loop
DoCmd.SendObject , , , strEmail, , , "PRR has been issued", "PR Number #" & " " & Forms!frmEnterReadAcrossSummary.PRRNumber & " " & "was entered into the system by" & " " & Forms!frmEnterReadAcrossSummary.Plant & " on" & " " & Format(Forms!frmEnterReadAcrossSummary.Date) & ". "
Set rsEmail = Nothing
MsgBox "Email notifications have been sent"
End Sub