Email specific plant

teiben

Registered User.
Local time
Today, 01:11
Joined
Jun 20, 2002
Messages
462
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
 
Make a query to list all the plants that need to be emailed and open up the query as rsEmail.

Select * from tblPlants where([PlantName]<> me.txtPlantName)
 

Users who are viewing this thread

Back
Top Bottom