concatenate query results to a string

G

Guest

In short, what is the easiest way to convert the results from a query, which
returns several email address for a project, into a string seperatated by
semi colon.

I can open a new mail item and I have a query which returns the contacts
(email addresses) for a project.

How do I concatenate email1 ":" email2 "; .... ?

Thanks for any help
 
A

Albert D. Kallal

The code looks much like:

Dim strSql As String
Dim str As String
Dim rst As DAO.Recordset

strSql = "select * from childTable where FKID = " & Me!ID
Set rst = CurrentDb.OpenRecordset(strSql)
Do While rst.EOF = False
If str <> "" Then
str = str & ";"
End If
str = str & rst!EmailName
rst.MoveNext
Loop
rst.Close
 
M

Marshall Barton

G

Gina Whipp

Just a thought,

Mine was too, then I removed the page numbers and it run like a gem.

HTH,
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

kehan said:
All good but that algorithm is a tad SLOW
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top