I have the following tables:
client {id_cliente(pk)}
collection {id_collection(pk),id_cliente(fk)}
invoice {id_invoice(pk),id_collection(fk)}
a collection, is 1 or more clients
an invoice, has only one colection_id
a client, can belong to 0 1 or more collections
When I am in the form, I am selecting several CLIENTS from a combobox, WHICH belong to the table CLIENT
when that happens, and I do select AT LEAST 1 CLIENT, the following should happen;
- create a NEW RECORD in table COLLECTION with a unique ID_COLLECTION and the ID_CLIENT which has been selected before
when I select more than 1 client, the following shoud happen
- create as many NEW RECORDS in table COLLECTION as ID_CLIENT’s I have selected previously
EXAMPLE:
selection of [1,2,3] clients [john,peter,martin]
-> this should trigger
creation of 3 records in table COLLECTION with the same ID_COLLECTION but with each one containing a unique ID_CLIENT
that way I know that in that invoice, there are 3 different clients and produce 3 copies of each invoice
KIND REGARDS,
JSD