Combining fields within multiple records

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to create mailing labels based on a name table. Within my table I have a new record for each member of a family. When I create labels, I can group by last name, street, city and zip (this will eliminate duplicates), however I also want to have added into this each person's first name who lives at the same address. This is where I am stuck. The only way I can get the first name is to have a seperate label

How can I combine a field that is in multiple records within the same table into one record: (I already have a unique ID associated with the address
 
hey Bridget,

Did you managed to find a solution to your problem?! I am trying to do the same thing as you, but still having no luck combining the fields from multiple records into one. Please advise me if you managed to solve your problem

Thanks
yann
 
You can create a calculated field that goes in front of the fields tha
are printed to your label. In this field refer to a VBA function.

source =GetFirstNames(address)

then create a vba function by the same name that will open the table
recordset separately (using the address criteria as a where argument
and concantenate the names together.
public function GetFirstNames(address as String) as String

set db = currentdb()
strSQL = "Select * from tblname where Address = '" & address & "'"
set rs = db.openrecordset(strSQL)
if (rs.eof and rs.bof) 'There are no records
do a no record routine here (which should not be possible)
else
rotate through all the records and concatenate the names together
newname = oldname, & newname from record
I ran out of room to write this, but this should give you the ide
 
I am trying to create mailing labels based on a name table. Within my table I have a new record for each member of a family. When I create labels, I can group by last name, street, city and zip (this will eliminate duplicates), however I also want to have added into this each person's first name who lives at the same address. This is where I am stuck. The only way I can get the first name is to have a seperate label.

How can I combine a field that is in multiple records within the same table into one record: (I already have a unique ID associated with the address)

Well... that may not be exactly what you want to do, in the 21st
century! My name's John Vinson; my wife's name is Karen Strickler. I'm
not part of "John and Karen Strickler", and she doesn't go by "John
and Karen Vinson" except in the most legalistic communications. Many
couples keep their own names; some have adopted or foster children who
keep their own last names.

What I do (in a similar table) is have a FamilyName field on the
unique address table. I have some VBA code which fills it with "Joe &
Jane Smith" if there are only two people with the same last name but
it can be overridden; the family with eight kids gets addressed as
"The _____ Family" rather than having ten names, for example!
 
Hi!

just wondering if there's anyway to sort the list by the name instead of the address? Thanks!

yann
 
Back
Top