Generate multiple new records based on form controls

zfind

Registered User.
Local time
Today, 11:15
Joined
Jul 11, 2008
Messages
55
Hi again everyone, thanks for the help so far but I need more!

I have a form (image attached for reference) that is used to create a new set of records. Users select the partner, the countries where it is present from the listbox, checks the channel boxes as applicable, fills in the remaining texts and then hits the generate button. What I want the associated macro to do is generate new records in a table (called 'tblPartnerSets', which already exists with the same fields as the form) that cover all of the selected combinations in the form. Maybe an example would be better:

If the user chooses:
"Partner A"
Brazil, Colombia and Chile
Channels A and C

I need the macro to create the following records.

Partner A, Brazil, Channel A
Partner A, Brazil, Channel C
Partner A, Colombia, Channel A
Partner A, Colombia, Channel C
Partner A, Chile, Channel A
Partner A, Chile, Channel C

The code needs to be able to accomodate only one partner, but up to 15-20 countries and 1 to five channels (but only one per record, obviously).

I have had no luck in doing this, but the form is set up and the boxes are populating perfectly. I messed around with some loops but the code to actually add records got me.

Can anyone help?
 

Attachments

  • example.JPG
    example.JPG
    28 KB · Views: 134

Users who are viewing this thread

Back
Top Bottom