C
|
clig 4/27/2007 |
I have been fooling with this for several days. And cut/pasted several examples of code from the forum to no avail. I have 2 tables. MAIN and ISSUES. They are joined by field SSN, which is a text field. Both tables also have fields "Emp_Last" and "Emp_First". I have a page that shows MAIN with the details of ISSUES once a SSN in entered. When I go to add a new ISSUE I need the fields "Emp_Last" and "Emp_First" to automatically fill in with data from the MAIN table. I was able to get the SSN field in ISSUE to auto fill using Session(strTableName &"_masterkey1") as the default value. Any and all help will GREATLY be appreciated. mgill@crawfordadvisors.com
|
V
|
Vladimir 4/27/2007 |
Hi, Sub ListOnLoad() str = "select Emp_Last,Emp_First from MAIN where SSN='" & Session(strTableName & "_masterkey1") &"'" Set rsTemp = server.CreateObject("ADODB.Recordset") rsTemp.open str, dbConnection Session("Emp_Last") = rsTemp("Emp_Last") Session("Emp_First") = rsTemp("Emp_First") rsTemp.close : set rsTemp = nothing End Sub
|
M
|
mlgill author 4/27/2007 |
Both ways work! THANK YOU SO MUCH! |
C
|
clig 4/30/2007 |
Hi, you can do it using ListOnLoad event for Issues table on Events tab: Then set up Session("Emp_Last") and Session("Emp_First") as Emp_Last and Emp_First default values on Visual Editor tab.
|
K
|
KingDean 9/25/2007 |
Technical information You will likely need to use editid(x) on ListOnLoad |