Welcome Guest, Not a member yet? Register   Sign In
Multiple forms and sub-tables in a single view
#2

Perhaps a different sequence of data collection would make this easier. Collect the items first and associate them to an 'orders' table entry later. Here's what I mean.

On the stand-alone 'items' view change the "Save Details" button to "Place Order" which, when clicked, opens the name/email view. On that screen change "Save Details" to "Continue". That click creates the 'orders' table entry saving the name/email data along with the foreign key value you've been using to group the items. Once saved, you go to a previously undiscussed "complete order" view.

Clearly the foreign key value - in 'orders' pointing to 'order_items' - cannot be taken from an auto-increment field of the 'orders' table' but will instead have to be generated during the item selection process.

Garbage collection of unordered items can be accomplished by checking the 'order_items" table for records where the 'order_number' column is not found in the 'orders' table. When to do GC however is an interesting question.

I assume you already have a scheme for clearing orders+items that never actually get ordered.
Reply


Messages In This Thread
RE: Multiple forms and sub-tables in a single view - by dave friend - 10-28-2017, 07:11 AM



Theme © iAndrew 2016 - Forum software by © MyBB