J
|
Jane 7/18/2006 |
Hi, Sub ListOnLoad(strSQL) str = "select * from MasterTable where FieldID="&strMasterKey set rs = server.CreateObject("ADODB.Recordset") rs.open str, dbConnection Session("FieldName") = rs("FieldName") End Sub
|
|
501267 7/19/2006 |
Thanks so much it works great! <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=9913&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' /> |
|
501268 7/26/2006 |
This works great, but I need it to do one more trick. How can I have it pass more than one value? For example, I need to set the default on the add page to the value of Field1, Field2 and Field3 from the list page? Hi, sure, you can do it using events. Proceed to the Events tab, select ListOnLoad event and put following code in it: where MasterTable is your actual table name, FieldID is a foreign key in the master table, FieldName is your actual field name. Then set Session("FieldName") as default value for the FieldName on the Edit format dialog on the Formatting tab. |
![]() |
Alexey admin 7/27/2006 |
Hi, Sub ListOnLoad(strSQL) str = "select * from MasterTable where FieldID="&strMasterKey set rs = server.CreateObject("ADODB.Recordset") rs.open str, dbConnection Session("FieldName") = rs("FieldName") Session("FieldName1") = rs("FieldName1") Session("FieldName2") = rs("FieldName2") ... End Sub
|
|
501269 7/27/2006 |
I tried something like that, but close only counts in horse shoes and hand grenades! <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=10075&image=1&table=forumreplies' class='bbc_emoticon' alt=':D' /> You make my little heart go pitter patter - it worked wonderfully as I am sure is no surprise to you. Hi, use this code in ListOnLoad event: and Session("Fieldname1") , Session("Fieldname2") etc as default values for your fields. |