Combining Field Entries into a single Field

  • Thread starter Thread starter Brian
  • Start date Start date
B

Brian

I have a contact database that has fields for the
following:

[FirstName]
[LastName]
[CompanyName]
[Address]
[Address 1]
[Address 2]
[Address 3]
[City]
[State]
[Zip]

I want to create a field in a query that combines the
entries in these fields into one field. In form view I
want to copy this field manually, hit a link to a word
letter template and hit paste so that the address shows
up. I can then type the letter and print. Any
suggestions how to create this new query field?
 
Brian said:
I have a contact database that has fields for the
following:

[FirstName]
[LastName]
[CompanyName]
[Address]
[Address 1]
[Address 2]
[Address 3]
[City]
[State]
[Zip]

I want to create a field in a query that combines the
entries in these fields into one field. In form view I
want to copy this field manually, hit a link to a word
letter template and hit paste so that the address shows
up. I can then type the letter and print. Any
suggestions how to create this new query field?

(untested)

FullAddress: [FirstName] & " " & [LastName] & Chr(13) & Chr(10)
& [CompanyName] & Chr(13) & Chr(10)
& ([Address 1] + (Chr(13) & Chr(10)))
& ([Address 2] + (Chr(13) & Chr(10)))
& ([Address 3] + (Chr(13) & Chr(10)))
& [City] & ", " & [State] & " " & [Zip]

The construct for the Address lines attempts to only include lines that actually
have data without leaving a blank spot where the field is null. The plus sign
causes that part to be null if either operand is null. If the expression
doesn't work as expected, strip it down and rebuild it one field at a time to
see where the problem is.
 
Back
Top