Results 1 to 3 of 3

Thread: Classic Master Detail form problem

Threaded View

  1. #1

    Thread Starter
    Fanatic Member sbasak's Avatar
    Join Date
    Aug 2001
    Location
    Globe Trotter
    Posts
    524

    Talking Classic Master Detail form problem

    This is a classic problem. I have two tables (master detail). When in detail table I insert the product quantity a trigger is there in database which populates Price columns. I have generated the form using Data Form Wizard.

    Transaction
    -----------
    TNo
    Customer
    Date
    Total

    Details
    -------
    TNo
    DtlNo
    ProductCode
    Quantity
    Price




    **********************************************
    --------------------------------------------
    [Load] [Cancel All] [Update]
    ---------------------------------------------
    TNo 500
    Customer J. Smith
    Date 2003-09-25
    Total
    ----------------------------------------------
    DtlNo ProductCode Quantity Price
    ----------------------------------------------
    100 1256879 1 100
    101 1356897 2 50
    102 1356878 2 200

    ----------------------------------------------
    **********************************************


    Now here are the problems

    [1] The master records has to be saved first before inserting detail records. If I don't save the master record first, child record can't be inserted. So, I have to insert a master record, click on Update, and then start inserting detail records.

    How can I overcome double saving concept?

    [2] There is a stored procedure in database, which returns the total sales amount if a particular "TNo" is passed as input. I want that when I click the update button all the following actions should happen -
    * Both master and detail records are saved
    * The total amount value is populated and saved. I know how to call a stored procedure in VB.NET, however, I am confused where I should call the procedure so that it populates the date just before saving the data.

    Thanks for any help. I think some you must have solved this. So, I shall be glad to know your approach.
    Last edited by sbasak; Sep 25th, 2003 at 06:16 AM.
    Life is a one way journey, not a destination. Travel it with a smile and never regret anything.
    Yesterday is history, tomorrow is a mystery, today is gift - that's why we call it present.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width