This topic is locked

Master and Detail record Add new on same page

8/6/2009 9:54:44 AM
ASPRunnerPro General questions
D
deeg author

I have a one page form that i am converting to a online database.
I want the user not to have to go to a second page to add detail.
For example:
They enter their basic info: Name, Department, Order Date, Order ID

Order Detail: Item No., Description, Quantity
How do I get this to display on a single add page with the Master Add at time and the detail add below

J
Jane 8/7/2009

Hi,
ASPRunnerPro doesn't support updating multiple tables on one page.

You can implement this manually using Before record updated/added events.
I.e. use something like this:

sql = "update AnotherTable set Field1='" & dict("Field1") & "' where IDField=" & dict("IDField")

dbConnection.Execute sql
dict.Remove("Field1")

D
deeg author 8/9/2009

Hi,

ASPRunnerPro doesn't support updating multiple tables on one page.

You can implement this manually using Before record updated/added events.
I.e. use something like this:


Thank you Jane.
How do I go directly to the detail for the new master record added/submitted and add the first detail record?

[indent][/indent]It is a supply requisition request. Includes their name, department, phone, etc.
After clicking add for the master (submit I need them to go to a page that shows the detail list with inline add) to begin to add the supply items requested.

J
Jane 8/10/2009

Hi,
use After record added event on the Events tab for this purpose.

Here is a sample:

Session("DetailTableName_masterkey1") = dict("FieldName")

Session("DetailTableName_mastertable") = "MasterTableName"

Response.Redirect "DetailTableName_add.asp"

D
deeg author 8/10/2009

Hi,

use After record added event on the Events tab for this purpose.

Here is a sample:


Jane thanks for your patience with me on this, but I am not allowing the user to go the an add page for the detail page, only want them to use inline add so how would this change the code?

J
Jane 8/10/2009

Hi,
here is a sample:

Response.Redirect "DetailTableName_list.asp?mastertable=MasterTableName&masterkey1=" & dict("FieldName")

D
deeg author 8/10/2009

Hi,

here is a sample:


Jane,
I added the following code:
Session("SRI_ReqDetail_masterkey1") = dict("Request_ID")

Session("SRI_ReqDetail_mastertable") = "SRI_Requests"
Response.Redirect "SRI_ReqDetail_list.asp?mastertable=SRI_REquests&masterkey1=" & dict("Request_ID")
--- It takes me to the inline add page, but it does not display the master table at the top. It is not picking up the primary key value from the master page.
This is what the address line shows on the redirect page (http://ttn03webiisdev1/interweb/forms/stockroomf/SRI_ReqDetail_list.asp?mastertable=SRI_REquests&masterkey1=)

Note:

The master table is SRI_Requests - the primary key is Request_ID

The detail table is SRI_ReqDetail - secondary key in child record is Request_ID

J
Jane 8/11/2009

Please see my changes below:

Response.Redirect "SRI_ReqDetail_list.asp?mastertable=SRI_REquests&masterkey1=" & keys("Request_ID")

D
deeg author 8/12/2009

Please see my changes below:



Jane,
This is still not working. This time it took me to the SRI_ReqDetail page and shows me all records. Am I missing a step to store the Primary key?

J
Jane 8/12/2009

It's difficult to tell you what's happening without seeing actual files.
Please publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages along with instructions on reproducing this error.