Hello!
I got a table “A” accessed by the mainForm and a table “B” accessed as its subForm. table “B” associates multiple entries with the primary key from table “A”, so that each row in “A” has one or more rows in “B” - not zero.
When first creating an entry in “A” a corresponding entry in “B” has to be created. More entries in “B” referencing “A” can be added later.
A real example: Table “A” holds products, Table “B” holds the price of the product and the date the price was changed. A query for an product always gets the latest corresponding price, so a entry in “B” must be ensured. An additional entry for the current price in “A” would pose another threat for inconsistency.
Following problem: If i add a new row to “A”, the row is added to the table before i can add the corresponding entry in the subForm for “B”. If i try to enter a new row in “B” first, there is no primary key in “A” i could enter, obviously. If - for some reason - the user stops after entering in “A” and forgets to enter a corresponding entry in “B”, i have an inconsistency.
My question: How can i ensure, that an entry in “A” and “B” is entered at the same time?
Thank you for your time and help
Regards
Karl