On 6 Jul 2006 18:24:52 -0700,
(E-Mail Removed) wrote:
>Question 1:
>
>Best method to cancel entering a new order?
>Say a user has entered 2 line items and some header info and decides to
>cancel the entry/order ...... in a simple 1 table scenario I would use
>Me.Undo ...... but as line item records have already been written to a
>separate table, what do I do ???? Would a Me.Undo trigger cascade
>delete and remove the offending lineitems OR would I need to do a
>delete where foreign key = .... On the lineitem table THEN do a
>Me.Undo ..... or is there a better way?
Undo won't work, period. When you setfocus to the subform the mainform
record is saved to disk; when you setfocus back to the mainform, or
move between records on the subform, the subform record will be saved.
You'll need to set Cascade Delete on the relationship between the main
form's table and the detail table, and run a Delete query or put a
button on the mainform to delete the current record; the child records
will be deleted by the cascade.
>Question 2
>
>I want to have the functionality for a user to be able to clone the
>lineitems from a chosen order number, but enter different header
>information (to save time etc) ... What is the best way to do that? I
>have not done anything along those lines before.
An Append query would work here. Not sure how you'ld want to enter the
different header data, or how you'ld pick which child records to
append though!
John W. Vinson[MVP]