This topic is locked

After Add Message Box

2/4/2007 5:55:28 PM
ASPRunnerPro General questions
F
fnqchick author

Hi there,
I want to add a message box to pop up after the user saves/edits a record. I want to give them the choice of either going directly to the approvals add page or back to the the updated list page.
Can anyone help me out with this?
Cheers,

FNQChick

Sergey Kornilov admin 2/4/2007

You can try the following code in AfterAdd/AfterEdit events. Make sure it appears as a single line of code.

Response.Write "<script>if (confirm('Proceed to Add approvals page?')) window.location = 'approvals_add.asp'; else window.location = '..._list.asp';</script>"
F
fnqchick author 3/25/2007

You can try the following code in AfterAdd/AfterEdit events. Make sure it appears as a single line of code.


Response.Write "&lt;script>if (confirm('Proceed to Add approvals page?')) window.location = 'approvals_add.asp'; else window.location = '..._list.asp';</script>"


Hi there,
The message box code is great thanks - working well except for one issue. It doesn't add the mastertable id to the newly opened add page. Is there something I can do to link them?
Thanks again.

J
Jane 3/26/2007

To save masterkey info add following code to the BeforeAdd/BeforeEdit events:

Session("DetailTable_masterkey1")=dict("ForeignKey")



where DetailTable is your actual table name, ForeignKey is your actual field name in the MasterTable where foreign key is stored.

F
fnqchick author 3/26/2007

To save masterkey info add following code to the BeforeAdd/BeforeEdit events:

where DetailTable is your actual table name, ForeignKey is your actual field name in the MasterTable where foreign key is stored.


Thanks for the reply Jane, unfortunately the masterkey1 is still coming up blank and will not link to the mastertable record...
I have added a message box to afteradd on mastertable that directs the user to a detail form_add.asp. After the detail form is filled out there is another message box to see if they want to add another record or not.
When this is complete the new detail records have a blank masterkey1.
I have the following on the mastertable after add and after edit:

Response.Write "<script> if(confirm('Would you like to add an expense item now?')) window.location='tblExpItems_add.asp'; else window.location='tblExpClaim_List.asp';</script>"
I have the following on the master table after add and after edit (I have also tried it on the detail table):

Response.Write "<script> if(confirm('Would you like to add another expense item now?')) window.location='tblExpItems_add.asp'; else window.location='tblExpItems_List.asp';</script>"
I have the following on the master table before add and before edit: (i also tried it on the detail table)

Session("tblExpItems_MasterKey1")=dict("ID_ExpClaim")
Can you see where I am going wrong?