Deborah
01-31-2003, 02:03 PM
make my report list a field, record by record, separated only by a comma and a space?
ie. [Email], next record[email], next record[email], etc.
Thanks for your help :)
bjackson
02-01-2003, 10:49 PM
do i understand you right
you want to combine all your records into 1 long record
Deborah
02-03-2003, 10:22 AM
Well, sort of... I want a report to list all email addresses (i.e. all records that aren't null in the email field) and separate them only by a comma and a space. I want this so that I can convert the list to Word and the user can easily copy and past ALL email addresses in the "To: " area of their Eudora email program. Eudora, unlike Outlook, calls for separation by comma, not semicolon.
Our office won't, under any circumstances, use Outlook, so I can't use any automation that Access might offer, unless there's a way to change the default email program to Eudora.
Since the data in the email field changes often, I'd really like to automate the function for my boss. The automation part is a breeze. I just don't know how to set up a report to have one field show records on the same line rather than offering a new line for each record.
Does that make sense? Thanks so much for your help :)
WayneRyan
02-03-2003, 11:06 AM
Deborah,
I don't use Word, so this is a group project:
You can make a command button, in the On-Click event:
' **********************************
Dim dbs As Database
Dim rst As Recordset
Dim sql As String
Dim strEmail As String
strEmail = ""
Set dbs = CurrentDb
sql = "Select * from MyTable where Not IsNull(EMail)"
set rst = dbs.OpenRecordset(sql)
While not rst.EOF and Not rst.BOF
strEmail = strEmail & ","
Wend
strEmail = Mid(strEmail, 1, Len(strEmail)-1) ' Trailing comma
'
' Now, all we have to do is start word and paste strEmail
' to Word or wherever
'
' **********************************
Wayne
Deborah
02-04-2003, 09:09 AM
Thanks so much Wayne. I'll give it a go some time this afternoon and let you know how it went. :)