473,385 Members | 2,044 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Multiple Names In A Mail Merge Field

I need to do a mail merge letter from my database. The letter will be addressed
to small companies and in the body of the letter I need to list employees of the
company. There will be from 1 to 15 employees. My database is all set up to
provide the names and addresses of the companies and the list of employees of
each company. I need help on how to do the employee merge field when there will
be multiple employees to be listed in this field.

Anyone?

Thanks!

Traci
Nov 13 '05 #1
3 2549
Probably the easiest way is to create the form letter in Word and use Word
to connect to the table or query that contains the information you need.
After making the connection from Word to Access and specifying a table or
query, you will have access to the fields and able to place them in the
appropriate locations in your letter. See Merge under Word.

You could also create a report in Access using the fields you need placed in
the area's where needed to create your form letter.

--
G Vaught

"Traci" <tm******@earthlink.net> wrote in message
news:Un*****************@newsread2.news.atl.earthl ink.net...
I need to do a mail merge letter from my database. The letter will be addressed to small companies and in the body of the letter I need to list employees of the company. There will be from 1 to 15 employees. My database is all set up to provide the names and addresses of the companies and the list of employees of each company. I need help on how to do the employee merge field when there will be multiple employees to be listed in this field.

Anyone?

Thanks!

Traci

Nov 13 '05 #2
Thanks for the quick response!

Yes, I have all that! My question is how to merge a list of names into the merge
document. How do I set up the merge field to be able to merge the list of names?

Traci
"GVaught" <gl****************@hotmail.com> wrote in message
news:u3**************@TK2MSFTNGP09.phx.gbl...
Probably the easiest way is to create the form letter in Word and use Word
to connect to the table or query that contains the information you need.
After making the connection from Word to Access and specifying a table or
query, you will have access to the fields and able to place them in the
appropriate locations in your letter. See Merge under Word.

You could also create a report in Access using the fields you need placed in
the area's where needed to create your form letter.

--
G Vaught

"Traci" <tm******@earthlink.net> wrote in message
news:Un*****************@newsread2.news.atl.earthl ink.net...
I need to do a mail merge letter from my database. The letter will be

addressed
to small companies and in the body of the letter I need to list employees

of the
company. There will be from 1 to 15 employees. My database is all set up

to
provide the names and addresses of the companies and the list of employees

of
each company. I need help on how to do the employee merge field when there

will
be multiple employees to be listed in this field.

Anyone?

Thanks!

Traci


Nov 13 '05 #3
Hi Traci

You can write a function which opens a recordset of the employees for the
given company (passed as an argument) and creates a string which is a list
of all the names. For example:

Function ListEmployees(CompanyID as long) as String
Dim rs as DAO.Recordset
Dim sList as String
Set rs = CurrentDb.OpenRecordset( _
"Select * from Employees where EmpCompany=" & CompanyID, _
dbForwardOnly)
With rs
Do until .EOF
sList = sList & !FirstName & " " & !LastName & vbCrLf
.MoveNext
Loop
.Close
End With
Set rs =- Nothing
' remove last Cr/Lf
ListEmployees = Left(sList, Len(sList)-2)
End Function

Now you can use this function in an expression in your query:
EmployeeList: ListEmployees([CompanyID])
....and then use the field EmployeeList as a merge field in your document.

This function lists one employee per line, but you might want to list them
some other way, say as a comma-separated list.
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand
"Traci" <tm******@earthlink.net> wrote in message
news:Un*****************@newsread2.news.atl.earthl ink.net...
I need to do a mail merge letter from my database. The letter will be addressed to small companies and in the body of the letter I need to list employees of the company. There will be from 1 to 15 employees. My database is all set up to provide the names and addresses of the companies and the list of employees of each company. I need help on how to do the employee merge field when there will be multiple employees to be listed in this field.

Anyone?

Thanks!

Traci

Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Christopher Harrison | last post by:
Is there a way to store an indefinite number of keys in one field and self join them? Imagine, for example, you have a table of users with a "friends" column. Say user 1 is friends with users 9, 7,...
3
by: Steve | last post by:
I have a people table of about 25 fields. The table is initially created each year from 5 different sources. The records from each source are appended to the people table. Any person may be in one...
2
by: William Wisnieski | last post by:
Hi Everyone, Access 2000 I have some code behind a button that performs a word merge with a query data source. The merge works fine. But what I'd like to do somehow is after the merge is...
1
by: svdh | last post by:
I have posed a question last saturday and have advanced alot in the meantime. But I am still not there Problem is that I try to merging various fields from various tables in one document in Word...
4
by: lesperancer | last post by:
I have 3 tables (office97) tblQuote quoteNbr tblDetails ( quote : 1 <-> M: quoteDetails) quoteNbr detailLine product value
0
by: Phil C. | last post by:
Hi, I'm using Access 2000. I have a Select Query that uses the MID function to separate the actual text of articles from the title of the articles. The articles are enterd into the...
1
by: mr k | last post by:
Hi, I wanted to use mail merge with forms but Text form fields are not retained during mail merge in Word, I got the code from Microsoft but it doesn't remember the text form field options such as...
1
by: christianlott1 | last post by:
I want to provide users with an interface to create a custom merge (all in Access, not Word). User will put in a set of brackets ("<>") in a memo field and when they click the merge button it will...
1
by: kirkus84 | last post by:
I am currently trying to do a multiple record mail merge through a query via a command button on a form. The query basically displays customers who have said yes to privacy. The user inputs a date...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.