Jump to content
Sign in to follow this  
Database Designs

Duplicate some records via Loop

Recommended Posts

I am importing records from another table. When I import them in if the "Spaces Allotted" field equals 2 than I need the record to be duplicated, if it equals 3 then I need it duplicated twice. I can Loop through and duplicate the record if "Spaces Allotted" = 2, but I'm having trouble if it =3 and also duplicating the last record if it needs it. Any help would be appreciated.

Share this post


Link to post
Share on other sites

Why don't you import them several times?

Share this post


Link to post
Share on other sites

You could import different found sets from the source table, based on different values of the “allotted” flag; i.e. go to source, find all allotted, go to target, import, go to source, search for allotted = 2, go to target, import, etc.

Share this post


Link to post
Share on other sites

I am suspicious of the need to have so many duplicate records. It raises a red flag to me.

Share this post


Link to post
Share on other sites

I am suspicious of the need to have so many duplicate records. It raises a red flag to me.

Me too. Though it reminds me of:

http://fmforums.com/forum/topic/42423-creating-small-label-printing-database/page__view__findpost__p__197906

Share this post


Link to post
Share on other sites

Two solutions for your problem:

1. Looping: open an new window, duplicate, close window. So your found set will stay the same. If you need it duplicated twice do this twice. Make sure that you do not use show all records (use a static found set, can be all records as well).

2. Add a repeating field to your source table. If you need duplication enter something in the first and second repetition, if you need the record three times put a value in repetition 1/2/3.... On import you may chose to spilt repeating fields into single records, so you get indention info on all records except for the contents of the repeating field.

I use this a lot to split reports into subsets, it's quite handy.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

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