Determine duplicate fields in consecutive records

U

UpRider

I'm having a bit of bother doing this.
I'm printing membership cards on a form, 10 to a page, 2 up. The cards are
sorted on last name, first name. Some of the cards are for family members
with each member of the family getting a card. After printing, the cards
need to be torn apart at the perfs and mailed in an envelope. Here's the
problem. I would like to print an "M" at the edge of the cards that should
all go in the same envelope to the same family. This makes it easy for the
stuffer to do his job. To print the "M", I need to know if the address of
the previous card already printed is the same as the current card. How might
this be coded?
Thanks for any help,
Barto
 
T

Terry

Barto,

One way of doing this:

Create a query with a calculated field such as
uniqueAddr:[surname]&[Address1]&[address2]&[state]&etc.
The reason for creating this field is to identify all
people you want grouped by address (I included the surname
so that borders or unrelated parties at the same address
are seperated - suit yourself) This field will not be used
on your report so it doesn't need to be formatted with
spaces cr & lfs.

Base a totals query on this query. Group by uniqueAddr and
count a populated field. In the criteria of the counted
field use >1 so that you only return records with more
than one addressee at each location. Include a calculated
field something like multiIdentifier:"M"

In your report data source add a field calculated in the
same way as above ([surname&[address1}&etc) this will be
used to join the new queruy into your record source. Add
the new query and join it so that all existing records are
included and only those from the new query which match are
included. Probably a good idea to have your primary
sorting on the calculated address field so that all
persons for a given address are grouped together. Your
record source will now have a an "M" for addressees which
share an address. Add it to your report.

HTH,

Terry
 
U

UpRider

Thanks, Terry. I'll digest this and give it a try.
Barto

Terry said:
Barto,

One way of doing this:

Create a query with a calculated field such as
uniqueAddr:[surname]&[Address1]&[address2]&[state]&etc.
The reason for creating this field is to identify all
people you want grouped by address (I included the surname
so that borders or unrelated parties at the same address
are seperated - suit yourself) This field will not be used
on your report so it doesn't need to be formatted with
spaces cr & lfs.

Base a totals query on this query. Group by uniqueAddr and
count a populated field. In the criteria of the counted
field use >1 so that you only return records with more
than one addressee at each location. Include a calculated
field something like multiIdentifier:"M"

In your report data source add a field calculated in the
same way as above ([surname&[address1}&etc) this will be
used to join the new queruy into your record source. Add
the new query and join it so that all existing records are
included and only those from the new query which match are
included. Probably a good idea to have your primary
sorting on the calculated address field so that all
persons for a given address are grouped together. Your
record source will now have a an "M" for addressees which
share an address. Add it to your report.

HTH,

Terry

-----Original Message-----
I'm having a bit of bother doing this.
I'm printing membership cards on a form, 10 to a page, 2 up. The cards are
sorted on last name, first name. Some of the cards are for family members
with each member of the family getting a card. After printing, the cards
need to be torn apart at the perfs and mailed in an envelope. Here's the
problem. I would like to print an "M" at the edge of the cards that should
all go in the same envelope to the same family. This makes it easy for the
stuffer to do his job. To print the "M", I need to know if the address of
the previous card already printed is the same as the current card. How might
this be coded?
Thanks for any help,
Barto


.
 
U

UpRider

Terry, it worked fine. Used join sql as the report datasource.
Barto.

Terry said:
Barto,

One way of doing this:

Create a query with a calculated field such as
uniqueAddr:[surname]&[Address1]&[address2]&[state]&etc.
The reason for creating this field is to identify all
people you want grouped by address (I included the surname
so that borders or unrelated parties at the same address
are seperated - suit yourself) This field will not be used
on your report so it doesn't need to be formatted with
spaces cr & lfs.

Base a totals query on this query. Group by uniqueAddr and
count a populated field. In the criteria of the counted
field use >1 so that you only return records with more
than one addressee at each location. Include a calculated
field something like multiIdentifier:"M"

In your report data source add a field calculated in the
same way as above ([surname&[address1}&etc) this will be
used to join the new queruy into your record source. Add
the new query and join it so that all existing records are
included and only those from the new query which match are
included. Probably a good idea to have your primary
sorting on the calculated address field so that all
persons for a given address are grouped together. Your
record source will now have a an "M" for addressees which
share an address. Add it to your report.

HTH,

Terry

-----Original Message-----
I'm having a bit of bother doing this.
I'm printing membership cards on a form, 10 to a page, 2 up. The cards are
sorted on last name, first name. Some of the cards are for family members
with each member of the family getting a card. After printing, the cards
need to be torn apart at the perfs and mailed in an envelope. Here's the
problem. I would like to print an "M" at the edge of the cards that should
all go in the same envelope to the same family. This makes it easy for the
stuffer to do his job. To print the "M", I need to know if the address of
the previous card already printed is the same as the current card. How might
this be coded?
Thanks for any help,
Barto


.
 

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