Combining Field Entries into a single Field

Combining Field Entries into a single Field

Post by Bria » Fri, 17 Oct 2003 05:50:22


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?
 
 
 

Combining Field Entries into a single Field

Post by Rick Brand » Fri, 17 Oct 2003 10:24:46


(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.


--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com