I have an Access 2002 database of people (both students and volunteers) involved in an after-school program. I need to create mailing labels for people with certain characteristics. Seemingly a simple operation, but I run into the issue of creating more than one label for the same address if two or more people who meet my selection criteria live there.
An example (and my immediate need): making labels for volunteers who are "table parents" (tables!Role!TableParent). People can have more than one "role". The person table (Person) and the role table (Role) have a one-to-many relationship (one person, many roles). The link is a PersonID field on the Role table. Other possible roles are "student", "teacher", etc.
People (tables!Person) are also linked to households (tables!Household) in a many-to-many relationship via a bridge table (tables!Relationships) which contains the primary key for both Person and Household. The household table has the address and phone number for everyone who lives there. This information is not in the Person table. To make labels, I created a query to link these tables together. The problem is, many of the table parents are husband and wife. My query results in a separate mailing label for the husband and the wife. It would be much better to make one label for each household where there is one or more people meeting the selection criteria (in this case, that is 'role="tableparent"'). This will also be an issue with labels for students and very likely other groups.
I found a previous post that seemed to send me in the right direction: PaulBricker's excellent reply to awinger on 10/19/02. Subject was "query construction for a mailing label." However, I've had trouble adapting awinger's solution for my needs.
I use VB quite a bit for programming forms, but am inexperienced with handling record sets. This is at least part of my problem. The Do Loop suggested by PaulBricker seems like a good solution, but I haven't been able to properly create or open the recordset I need in order to try out the Do Loop.
I hope I've sketched out the problem completely. I would be most grateful if someone could point me in the right direction.
Many thanks,
Dave Lamb
An example (and my immediate need): making labels for volunteers who are "table parents" (tables!Role!TableParent). People can have more than one "role". The person table (Person) and the role table (Role) have a one-to-many relationship (one person, many roles). The link is a PersonID field on the Role table. Other possible roles are "student", "teacher", etc.
People (tables!Person) are also linked to households (tables!Household) in a many-to-many relationship via a bridge table (tables!Relationships) which contains the primary key for both Person and Household. The household table has the address and phone number for everyone who lives there. This information is not in the Person table. To make labels, I created a query to link these tables together. The problem is, many of the table parents are husband and wife. My query results in a separate mailing label for the husband and the wife. It would be much better to make one label for each household where there is one or more people meeting the selection criteria (in this case, that is 'role="tableparent"'). This will also be an issue with labels for students and very likely other groups.
I found a previous post that seemed to send me in the right direction: PaulBricker's excellent reply to awinger on 10/19/02. Subject was "query construction for a mailing label." However, I've had trouble adapting awinger's solution for my needs.
I use VB quite a bit for programming forms, but am inexperienced with handling record sets. This is at least part of my problem. The Do Loop suggested by PaulBricker seems like a good solution, but I haven't been able to properly create or open the recordset I need in order to try out the Do Loop.
I hope I've sketched out the problem completely. I would be most grateful if someone could point me in the right direction.
Many thanks,
Dave Lamb