Hi there,
I'm using the code below to loop through a record set and select Email addresses of certain users to send them email automatically. How can I modify this code so I can add a filter.??
I want to select only users that belong to certain Group(Group is a Text field in the tbl_users) and I want ReceiveEmail=True (ReceiveEmail is a boolean field in the same table also)
rst.Open "tbl_Users", CurrentProject.Connection, adOpenForwardOnly
Do While Not rst.EOF
strTo = strTo & Nz(rst.Fields("EmailAddress").Value) & "; "
rst.MoveNext
Loop
SendEmails(strTo, strSubject, strMessage)
Many Thanks in advance.
Ronaldo
I'm using the code below to loop through a record set and select Email addresses of certain users to send them email automatically. How can I modify this code so I can add a filter.??
I want to select only users that belong to certain Group(Group is a Text field in the tbl_users) and I want ReceiveEmail=True (ReceiveEmail is a boolean field in the same table also)
rst.Open "tbl_Users", CurrentProject.Connection, adOpenForwardOnly
Do While Not rst.EOF
strTo = strTo & Nz(rst.Fields("EmailAddress").Value) & "; "
rst.MoveNext
Loop
SendEmails(strTo, strSubject, strMessage)
Many Thanks in advance.
Ronaldo