Jump to content
Sign in to follow this  
Steve S

Form Letter and Duplicate records

Recommended Posts

I have a db that I use to track art and the supplier of the art.

I preform a search for all the art that I used last month and wish to send a letter to each of the suppliers of that art.

I have made the form letter, but here is the problem. Since I may have used 5 pieces of art from one supplier, there are 5 occurances of that supplier in my form letter layout.

I hope that makes sense. How can i weed out the duplicates so it will only print one page for each supplier.

sorry if that was confusing

Share this post


Link to post
Share on other sites

For printing your letters, you could put the whole thing on a Sub-summary part, then sort by supplier. That way you can print one of each, no need to find the duplicates.

But if you want to find dupes: in Find mode, an exclamation point ("!", without the quotes) in any field will find the duplicates, but then you have to run a looping script to Omit them.

However... for future reference, you will be able to manage things much better by breaking the suppliers and art into separate related files. Duplicating your contacts like that as you have just found out is bound to cause problems.

Share this post


Link to post
Share on other sites

quote:

Originally posted by Steve S:

I have a db that I use to track art and the supplier of the art.

I preform a search for all the art that I used last month and wish to send a letter to each of the suppliers of that art.

I have made the form letter, but here is the problem. Since I may have used 5 pieces of art from one supplier, there are 5 occurances of that supplier in my form letter layout.

I hope that makes sense. How can i weed out the duplicates so it will only print one page for each supplier.

sorry if that was confusing

Hi there,

here's how you can acheive this:

create two global fields mySupliersList and globalRecID

define relationship "Supliers" from mySupliersList to Supliers

and firstRecord as calc Supliers:: RecID from relationship Supliers.

define relationship "onlyFirstOne" from globalRecID to RecordID

( if you don't have it than create it now)

Create an layout with only one field on it:

Supliers::firstRecord

Create an script named findFirstOnes

code:

Freeze Window

Set error capture [on]

Set Field [globalRecID,""]

Find All

Go Layout [your one field layout]

Copy All records

Go To Layout [ layout with filed globalRecID on It]

Paste[globalRecID,select]

Go to Related record ["onlyFirstOne",show only related records]

HTH

Dj

Share this post


Link to post
Share on other sites

Thanks you two..

especially Fitch, that suggestion about putting it in a sub summary art was just the easy solution I was looking for. DJ's response made me dizzy, so I stuck to yours smile.gif

And by the way, I do have this set up as a relational database, one db for suppliers and one for art.

I dont have duplicate records for my suppliers, I have many art records linked to one supplier record... So when I do a search on the art, I get multiple hits on the same supplier record.

But thanks alot, after fussing with it for some time I got it working the way I want.

Now I find I have a smiliar problem with my labels.. I want to do the same thing, but with labels instead of a form letter.. I've been fussing with sub summary parts, but cannot quite get it right.

Maybe I have to get dizzy...

smile.gif

[ April 12, 2002, 06:48 AM: Message edited by: Steve S ]

Share this post


Link to post
Share on other sites

Re: your labels, first just use one of the pre-set label layouts, then double-click on the body part and change it to a sub-summary.

However, now that we have the whole story, I think you should try something along the lines of dj's solution. It's really not too tricky.

1. In your art file, create a global text field, let's call it gArt. Put this field on a layout somewhere, or make a layout to put it on.

2. Create a relationship to your suppliers file, gArt::supplier id. We'll name this relationship... suppliers.

3. Make a layout (we're still in the art file) that has ONLY the supplier id field on it.

4. Now make a script:

. Go to layout (supplier id).

. Copy all records.

. Go to layout (with gArt on it).

. Paste into gArt.

. Go to related records (suppliers, show only related).

Basically the same script dj already posted. Possibly the confusing part was the self-relation, I don't know. But that isn't the case here -- you already have two related files.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.