One way to accomplish this, would be using 2 querys (and 2 loops, nested).
emails_query = query to get the <b>distinct </b>email accounts having new records.
shipments_query = query to get the shipments of one specific email address (the current from the emails_query)
I don’t really know the syntax you should use here, so make the necessary corrections, and pay atention to the logic only.
<pre>Set qdf = CurrentDb.QueryDefs(“emails_query”)
Set rst = qdf.OpenRecordset
Do Until rst.EOF
strInfo = strInfo & rst!stCompanyName & vbTab
set qdf2 = CurrentDb.QueryDefs(“shipments_query”)
Set rst2 = qdf2.OpenRecordset
Do Until rst2.EOF
strInfo = strInfo & “Ref No.” & rst2!siShipmentReference1 & vbCrLf
Body$ = “***Do not reply to this e-mail. We will not receive your reply.” & vbCrLf & vbCrLf & “The following new shipments have been shipped :” & vbCrLf & vbCrLf & strInfo & vbCrLf & vbCrLf & “See detailed activity at ” & webaddress & ” ” & Chr(</pre>