Merging fields using Access Database.

C

Carol G

I use this function in an Access Report to Format Peoples names properly.
I wish to merge a word letter with my Access query but I don't know where in
Word I would place this code or something like it. Can I use a variable to
hold my result, in place of the merge fields drop down list which just
lists each field individually?
Any help would be appreciated.
Thanks,
Carol


Private Function Name_Concatenate()

Dim strFullName As String



If ComLaw = True Then

strFullName = FName1 & " " & LName1 & " " & "and" & " " & FName2 & " " &
LName2

Else

If IsNull(FName2) Then

strFullName = FName1 & " " & LName1

Else

strFullName = FName1 & " and " & FName2 & " " & LName1

End If

End If



Name_Concatenate = strFullName



End Function
 
D

Doug Robbins - Word MVP

Use IIF functions in a Query in Access to do the concatenating and then use
that Query as the data source for you mail merge.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
C

Carol G

Thanks,
I was hoping learn how to do some of this in word (not just because of the
name concatenation) but I wish to use the same query filtered with a
userform for choices then merged. I don't know the capabilites or
difficulties in using word for this.
I managed to use an If Then Word Field with another one nested inside it to
accomplish the concatenation on the page but it was difficult to keep track
of, all lumped together that way.
I am going to buy a manual in the next few days but could you direct me to
some good sites to help me understand the Word objects and how they are put
together?
It seems awfully complicated compared to Access.
Thanks for your help
Carol
 
D

Doug Robbins - Word MVP

Are you talking about merging the information from multiple records in your
database into multiple Word documents or just inserting the information from
one record at a time into a Word document.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
C

Carol G

from 1 record to 1 merge, but something like. One merge filtered by "City"
or possibly by "Type of Customer"
etc.
 

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