This topic is locked

Session Variable or Insert Into

1/21/2011 10:29:47 PM
ASPRunnerPro General questions
F
fenhow author

Hi, I have a users table,it has ID, UN, PW and Rate
also have a main table
I am trying to auto insert or set as default value the Rate from the users table in the field rate from the main table whenever a/the user adds a new record.
Session("Username") in place and working. When I add a new record into the main table the username works perfectly as the default name..
I tried SESSION("_<tblUsers>_Rate")in the Global After Successfull log in and then added the code to the Day Rate field on my main table.
Something runs, when I add a new record it inserts a 0 in the field versus the number in the tblUsers Day Rate..
Any suggestions or is this even possible?
Thanks.

Fen How

Sergey Kornilov admin 1/22/2011

As a first step save values from users table in session variables. Here is an example:

http://xlinesoft.com/asprunnerpro/docs/save_user_data_in_session_variables.htm
Then use those session variables as default values on "Edit as" dialog.

F
fenhow author 1/22/2011

Thanks, is it suppose to be:
Session("Rate"] = data("Day Rate")
or
Session("Rate") = data("Day Rate")
Also in the edit as for the Day Rate field in my main table, Do I add thi. Session("Rate)as the default value?
Thanks.
Fen

F
fenhow author 1/22/2011

I kind of got it to work but when I add a new record the field "Day Rate" is blank, when I click in it though I see the default rate as placed in the "Rate" col of the Users table. Unless I click in the box and select it, the value does not show up once I save the new record.
This is what I am using:
Global event: Session("Rate") = data("DayRate")
Session Var: Session("Rate") in the "Edit as and control is a Text field.
Fen

Sergey Kornilov admin 1/23/2011

Correct syntax is Session("Rate") = data("Day Rate")
It looks like you something is not right there. Setting default value for a field in certain table won't affect another table (Users).
If you have an active support contract post your application to Demo Account and open a ticket at http://support.xlinesoft.com sending your Demo Account URL. 'Demo Account' button can be found on the last screen in the program.

F
fenhow author 1/23/2011

Thanks, I did and it is posted. Please advise..
Fen

Sergey Kornilov admin 1/23/2011

Not seeing your ticket anywhere.