You might as well make use of an UDF, just keeping it out of the procedure. Get the criteria by which you filter the result. Then you simply pass the criteria. I am not sure how you have built your criteria. A stab in the dark is get all email of people named "Paul". So your code will be.
Public Sub getEmailString(FieldName As String, Tablename As String, Criteria As String)
Dim tmpRS As DAO.Recordset
Dim tmpStr As String, retStr As String
tmpStr = "SELECT " & FieldName & " FROM " & Tablename & " WHERE " & Criteria
Set tmpRS = CurrentDB.OpenRecordset(tmpStr)
If tmpRS.RecordCount > 0 Then
Do While Not tmpRS.EOF
retStr = retStr & tmpRS.Fields(0) & ";"
tmpRS.MoveNext
Loop
End If
getEmailString = retStr
Set tmpRS = Nothing
End Sub
To use it, you simply use.
Dim someEmailString As String
someEmailString = getEmailString("EmailFieldName", "ContactsTableName", "FirstName = 'Paul'")
If you have something it should return,
paul.someone@somedomain.com;paul.someoneelse@somenewdomain.co.uk;
Hope this helps.