This topic is locked

PLEASE PLEASE PLEASE Help!! - Default Value on Add Page

3/16/2009 11:46:17 AM
ASPRunnerPro General questions
C
Conrunner author

Hi

I am sure this is very simple, so forgive me, but I just can't figure it out.

I have a Lookup Table which has 4 Columns...

Username, Password, Practitioner's Name, Practitioner's E-Mail Address

Practitioners log in using their Username and Password in order to access an Add Page to submit Data to another Table.

On the Add Page I have two fields - Practitioner's Name, Practitioners E-Mail Address.

When the Practitioner logs in, I have it set that the Practitioner's Name field is automatically populated with thier name taken from the Lookup Table, I have done this I think by assigning the default value of this field to "Session("_" & strTableName &"OwnerID")".
What I want to do however quite simply is to also automatically populate the Practitioner's E-Mail Address field on the Add page with the E-Mail Address taken from the same Record in the Lookup Table. I have tried also assigning this a default value of "Session("
" & strTableName &"_OwnerID")" but nothing happens.
As you have probably guessed by now, I am a complete novice so I really would appreciate any help, explained as simply as possible for a dummy like me.

Many Thanks.

Con.

Sergey Kornilov admin 3/16/2009

I recommend to post your application to Demo Account (last tab in ASPRunnerPro) and contact support team directly at http://support.xlinesoft.com

R
Roger 3/20/2009

... automatically populate the Practitioner's E-Mail Address field on the Add page with the E-Mail Address taken from the same Record in the Lookup Table.

Con.


This is a pretty straight foreward thing to do in the AfterSuccessful login event. Try something like this:
set rs = dal.TABLENAME.Query("UserID='" & username & "' and Password='" & password & "'","")
session("sessPractitioner")=rs("FIELDNAME").
Then use session("sessPractitioner") as the default value on the add page.
I do this all the time and it works very well as it only needs to occur once during login.
Hope this helps.
ps: the code is not necessarily exact, but I think it gives you the idea...