mail merge query challange

  • Thread starter Thread starter Han
  • Start date Start date
H

Han

I'm trying to create an Access query for a MS Word 2K mail merge letter.

Several people need to be referenced in the same one letter, which means the
data source needs to contain all the required fields.

The trick (at least in my mind) is how to retreive multiple names in one
query.

I have a contact table which contains the names, addresses and professions
of all the participants.

I need the query to return the first and last name for several people.

My letter looks something like this:

Dear {ClientFirstName),

Your appointment with Dr. {DoctorFirstName} {DoctorLastName} is schedule for
Tuesday, September, 9, 2003, at 2 p.m. He will be assisted by RN
{NurseFirstName} {NurseLastName}.

Please contact {AgentFirstName} {AgentLastName} if you have any questions or
need to reschedule.

Sincerely,
{RepFirstName} {RepLastName}

How can this be accomplished? Is this a SQL thing or MS Word?

Thanks in advance,
Han
 
It's kinda hard to answer when we don't know your table structure. I would
guess that all the shown fields could be generated in a single row in a
query.
If each document requires parts from multiple records, you can do this with
codes in Word or you can concatenate multiple records together.
 
Duane, allow me to back-up and just focus on my query challenge.

Using one query, I would like to return multiple contacts by assigning them
different names.

My "Contacts" table looks like this:

ContactID, FirstName, LastName

I need to return the FirstName and LastName for each ContactID.

SELECT [Contacts].[FirstName] AS ClientFirstName, [Contacts].[LastName] AS
ClientLastName, [Contacts].[FirstName] AS DoctorFirstName,
[Contacts].[LastName] AS DoctorLastName, [Contacts].[FirstName] AS
NurseFirstName, [Contacts].[LastName] AS NurseLastName,
FROM Contacts

The challenge is how to distinguish each ContactID in the WHERE clause to
correspond with the first and last names. The goal here is the have a nice
mail merge data source containing all the contact names.

Does this make sense? Is this possible?

Thanks,
Han
 
I'm afraid it still makes no sense to me.

--
Duane Hookom
MS Access MVP


Han said:
Duane, allow me to back-up and just focus on my query challenge.

Using one query, I would like to return multiple contacts by assigning them
different names.

My "Contacts" table looks like this:

ContactID, FirstName, LastName

I need to return the FirstName and LastName for each ContactID.

SELECT [Contacts].[FirstName] AS ClientFirstName, [Contacts].[LastName] AS
ClientLastName, [Contacts].[FirstName] AS DoctorFirstName,
[Contacts].[LastName] AS DoctorLastName, [Contacts].[FirstName] AS
NurseFirstName, [Contacts].[LastName] AS NurseLastName,
FROM Contacts

The challenge is how to distinguish each ContactID in the WHERE clause to
correspond with the first and last names. The goal here is the have a nice
mail merge data source containing all the contact names.

Does this make sense? Is this possible?

Thanks,
Han

Duane Hookom said:
It's kinda hard to answer when we don't know your table structure. I would
guess that all the shown fields could be generated in a single row in a
query.
If each document requires parts from multiple records, you can do this with
codes in Word or you can concatenate multiple records together.

--
Duane Hookom
MS Access MVP


means
the schedule
for questions
 
Alrighty then.

Duane Hookom said:
I'm afraid it still makes no sense to me.

--
Duane Hookom
MS Access MVP


Han said:
Duane, allow me to back-up and just focus on my query challenge.

Using one query, I would like to return multiple contacts by assigning them
different names.

My "Contacts" table looks like this:

ContactID, FirstName, LastName

I need to return the FirstName and LastName for each ContactID.

SELECT [Contacts].[FirstName] AS ClientFirstName, [Contacts].[LastName] AS
ClientLastName, [Contacts].[FirstName] AS DoctorFirstName,
[Contacts].[LastName] AS DoctorLastName, [Contacts].[FirstName] AS
NurseFirstName, [Contacts].[LastName] AS NurseLastName,
FROM Contacts

The challenge is how to distinguish each ContactID in the WHERE clause to
correspond with the first and last names. The goal here is the have a nice
mail merge data source containing all the contact names.

Does this make sense? Is this possible?

Thanks,
Han

Duane Hookom said:
It's kinda hard to answer when we don't know your table structure. I would
guess that all the shown fields could be generated in a single row in a
query.
If each document requires parts from multiple records, you can do this with
codes in Word or you can concatenate multiple records together.

--
Duane Hookom
MS Access MVP


I'm trying to create an Access query for a MS Word 2K mail merge letter.

Several people need to be referenced in the same one letter, which means
the
data source needs to contain all the required fields.

The trick (at least in my mind) is how to retreive multiple names in one
query.

I have a contact table which contains the names, addresses and professions
of all the participants.

I need the query to return the first and last name for several people.

My letter looks something like this:

Dear {ClientFirstName),

Your appointment with Dr. {DoctorFirstName} {DoctorLastName} is schedule
for
Tuesday, September, 9, 2003, at 2 p.m. He will be assisted by RN
{NurseFirstName} {NurseLastName}.

Please contact {AgentFirstName} {AgentLastName} if you have any questions
or
need to reschedule.

Sincerely,
{RepFirstName} {RepLastName}

How can this be accomplished? Is this a SQL thing or MS Word?

Thanks in advance,
Han
 
Back
Top