This topic is locked

Help with Master to Detail

10/28/2004 1:17:57 PM
ASPRunnerPro General questions
lhastings author

Hi,
I have a Customer Contacts Screen (Customer Code, Name, Address etc) with a link through to a Detail screen showing the Customers Health History. In the History I have 'Add New'.
Does anyone have any idea how I could pre-fill the Customer Code on the 'Add New' screen. We keep messing up the new Health records by putting in the wrong Customer Code.
Help appreciated. If your mum is having a menopause we have the right stuff to sort her out!..... Though we would probably send it to the wrong address.
Cheers,

Lee

Sergey Kornilov admin 10/29/2004

Lee,
here is how you can do this:

  1. Use Display master table info on details page option
  2. Set default value for Customer Code field to Session("Customer Code") (Details table). You can do this on the formatting screen.
  3. Modify Details table list page to store current Customer Code in the :
    Call DisplayMasterTableInfo(rsMaster)

    Session("Customer Code") = rsMaster("Customer Code")
    rsMaster.Close

    set rsMaster=Nothing

    dbConnection.Close

    set dbConnection = nothing


After that Customer Code field will be populated automatically on the ADD page.

lhastings author 11/3/2004

Hi,
Partial success.
I changed the Session("Customer Code") (Details table) to Session("Customer Code") ("Details table") as I was getting an error requesting the Customer Health History (Details table list page).
'Add New' functions, but is only ever saving to a Customer Code of 0 so I can't subsequently see the history on the Customer Health History (Details table list page).
Help appreciated.
Cheers,

Lee

Sergey Kornilov admin 11/4/2004

Lee,
default value needs to be set to Session("Customer Code"). This applies to Customer Code field in Customers Health History table.

lhastings author 11/4/2004