|
Stu author 4/16/2009 |
Answering my own question again! I have a MASTER table "CompanyAddressCodeValid" and it links to a DETAIL table "Contacts" In the MASTER table my key name is "Location Code" and in the DETAIL table its also "Location Code" I need to reference something from my MASTER table when an Add page for the DETAIL table is Displayed. I want to give one of the fields a Default Value with the option for the user to change the Default to something else. I just need the MASTER key value so I can write my Queries to get that value. I have tried every syntax to get that MASTER Key. So, I have resorted to trying to write it to the screen to make sure I've got the right reference. Example, as a code snippet in the Add page and even in the list page of the DETAIL table:- Response.Write Session("CompanyAddressCodeValid" & "_masterkey1") I don't get anything! I must have the wrong syntax or maybe the value isn't available. Please advise me. (Alternatively, I can present my default value by using the Lookup Wizard for that field in the Add screen but I want the user to type their own. I can use "Add a Value" to the Lookup Table because its a GroupBy Query. I can do the Default Value b y Query if only I can reference the MASTER Key) |
|
Stu author 4/22/2009 |
Grrrrr!!!! Answering my own question again! Use the code :- Session("SomethingINeedLater")= rs("TheNameOfTheFieldIWantTheValueOf") You can put this code in the List Page After Record Processed EVENT Then, in the Add Page Before Process EVENT you can reference Session("SomethingINeedLater") I can then write a Query with that Session value Any other alternatives, if its not too much trouble would be useful. Regards, Stu |
![]() |
Admin 4/22/2009 |
Correct syntax is SESSION(strTableName & "_masterkey1"). This way you don't have to worry about table prefixes. |