This topic is locked

Add Page - Get Passed Values

11/24/2009 10:12:05 PM
ASPRunnerPro General questions
P
paulwebb author

Add New Record:
I'm trying to populate some fieds depending on if from "add new" menu item (calls Page_add) or from a list - where a Field is passed to Page_add and populated - but how do I access the field passed BEFORE 'BeforeAdd'?
I can get MasterTable value, but tried and failed to get the field passed with numerous varations of Session("") and Reguest. - with 'masterkey' and 'editid', etc.

I think it's to early in the cycle for Values("") to work - tried it too.

J
Jane 11/25/2009

Hi,
I'm not sure that I understand your question.

What values do you want to pass to the add page?

P
paulwebb author 12/9/2009



Hi,
I'm not sure that I understand your question.

What values do you want to pass to the add page?



I want to populate the add page with values from the last record - essentially make add page be like copy, but not for all fields - and only if a previous record to copy exists

J
Jane 12/10/2009

Hi,
select values from database in the Add page: Before process event on the Events tab and save it in the session variables.

Here is a sample:

str = "select Field1,Field2,Feld3 from TableName order by IDField desc"

Set rstmp = server.CreateObject("ADODB.Recordset")

rstmp.open str,dbConnection

Session("Field1") = rstmp("Field1")

Session("Field2") = rstmp("Field2")

Session("Field3") = rstmp("Field3")

rstmp.close

set rstmp=nothing



Then use Session("Field1"), Session("Field2") and Session("Field3") as default values on the "Edit as" settings dialog on the Visual Editor tab.