J
Jock
Hi group,
I am needing assistance witht he logic in my loop as below.
Basically what I am trying to achieve is to populate an unbound
textbox with email addresses of those in the qualifying SQL statement.
However, I am getting an "Item not found in this collection" error
Any ideas where I am going wrong.
Private Sub Command2_Click()
Dim qry As String, rst As Object
qry = "SELECT Employees.Email FROM DistributionList INNER JOIN
Employees ON DistributionList.ID = Employees.DistributionList.Value
WHERE (((DistributionList.DistributionList)='Chemistry'));"
Set rst = CurrentDb.OpenRecordset(qry)
rst.MoveFirst
Do While Not rst.EOF
Form!EmailAddresses.Value = rst!Employees.Email
rst.MoveNext
Loop
End Sub
I am needing assistance witht he logic in my loop as below.
Basically what I am trying to achieve is to populate an unbound
textbox with email addresses of those in the qualifying SQL statement.
However, I am getting an "Item not found in this collection" error
Any ideas where I am going wrong.
Private Sub Command2_Click()
Dim qry As String, rst As Object
qry = "SELECT Employees.Email FROM DistributionList INNER JOIN
Employees ON DistributionList.ID = Employees.DistributionList.Value
WHERE (((DistributionList.DistributionList)='Chemistry'));"
Set rst = CurrentDb.OpenRecordset(qry)
rst.MoveFirst
Do While Not rst.EOF
Form!EmailAddresses.Value = rst!Employees.Email
rst.MoveNext
Loop
End Sub