I have written the code below that sends and email to a person when someone changes a task that the person needs to attend to. Now, I'd like to send an email to a list of people. I have a query that complies the list, but I don't know how to loop though that list to send to multiple people. If you could help, that would be great!
______________________________________________________
Private Sub UpdatesStillNeeded_Click()
Dim answer As Integer
Dim EmailText As String
Dim ToReceiver, Subject As String
EmailText = "The Project Aging database is ready to be updated"
ToReceiver = DLookup("EmployeeEmailAddress", "Tlkp_Employee", "ConsultantLookup = [EmployeeLName]")
Subject = "Project Aging Database"
answer = MsgBox("Do you want to send an email ", vbYesNo, "Send Email?")
If answer = vbYes Then
DoCmd.SendObject acSendNoObject, , , ToReceiver, , , Subject, EmailText, False
End If
End Sub
______________________________________________________
Private Sub UpdatesStillNeeded_Click()
Dim answer As Integer
Dim EmailText As String
Dim ToReceiver, Subject As String
EmailText = "The Project Aging database is ready to be updated"
ToReceiver = DLookup("EmployeeEmailAddress", "Tlkp_Employee", "ConsultantLookup = [EmployeeLName]")
Subject = "Project Aging Database"
answer = MsgBox("Do you want to send an email ", vbYesNo, "Send Email?")
If answer = vbYes Then
DoCmd.SendObject acSendNoObject, , , ToReceiver, , , Subject, EmailText, False
End If
End Sub