D
DianaS
Hi,
I would like to automatically insert names from my ACCESS database into a
WORD document. The Word document will be a letter sent out to customers.
Each AutoIDNumber is assigned one or two people's names.
For example, AutoIDNumber=342 could contain Bob Jones
and AutoIDNumber=346 could contain Jane Doe AND Mark Doe. For a particular
record, there are [First Name1], [Last Name1], [First Name2], and [Last
Name2] fields. [First Name2] and [Last Name2] are not always occupied.
[Last Name1] does not necessarily have the same value as [Last Name2],
although it often does.
I know how to insert fields into a Word letter, but I wonder if there is a
way to write code so that when the record contains only a single person's
name, the salutation reads "Dear [First Name1] [Last Name1]" AND
when the record contains two people's names, then the salutation reads "Dear
[First Name1] and [First Name2] [Last Name1]." In the case that [Last Name1]
does not equal [Last Name2], then I would like the salutation to read "Dear
[First Name1] [Last Name1] and [First Name2] [Last Name2]. Is there an
elegant way to do this? I would like to automatically generate letters
according to the above situations. I do not want to manually sort through
records. Does anyone know how to do this?
Thank you,
Diana
I would like to automatically insert names from my ACCESS database into a
WORD document. The Word document will be a letter sent out to customers.
Each AutoIDNumber is assigned one or two people's names.
For example, AutoIDNumber=342 could contain Bob Jones
and AutoIDNumber=346 could contain Jane Doe AND Mark Doe. For a particular
record, there are [First Name1], [Last Name1], [First Name2], and [Last
Name2] fields. [First Name2] and [Last Name2] are not always occupied.
[Last Name1] does not necessarily have the same value as [Last Name2],
although it often does.
I know how to insert fields into a Word letter, but I wonder if there is a
way to write code so that when the record contains only a single person's
name, the salutation reads "Dear [First Name1] [Last Name1]" AND
when the record contains two people's names, then the salutation reads "Dear
[First Name1] and [First Name2] [Last Name1]." In the case that [Last Name1]
does not equal [Last Name2], then I would like the salutation to read "Dear
[First Name1] [Last Name1] and [First Name2] [Last Name2]. Is there an
elegant way to do this? I would like to automatically generate letters
according to the above situations. I do not want to manually sort through
records. Does anyone know how to do this?
Thank you,
Diana