This topic is locked

calculating on add form

3/28/2011 5:02:09 AM
ASPRunnerPro General questions
A
adnankmk author

I have two tables.
BPS_Table.

ID

Emp_Desig

Scale
Emp_Data.
Emp_Desig

Scale

Filled

Total
I want to display the Total field from Emp_Data table in the add employee form when i select the particular id against the field.I want to add more employees against the existing scale. When i add the employees these should be automatically added in the total field and total should show the sum of previous and new added employees.
For example.
I have added 4 employess agaisnt bps 5. I want to add 3 more employees of bps 5. When i select the bps five agaisnt the particular id already entered. The total entered in the table should be 7. How i should do this in asp runner 6.3.

Sergey Kornilov admin 3/28/2011

I guess you need to use BeforeAdd event where you can run a SQL query to calculate the total number of employees for selected BPS. Then you can update Total field with this number.

A
adnankmk author 3/29/2011



I guess you need to use BeforeAdd event where you can run a SQL query to calculate the total number of employees for selected BPS. Then you can update Total field with this number.


set dal_table=dal.Table("Emp_Data")
dal.Table("Emp_Data").Param("ID")=values("ID")
dal.Table("Emp_Data").Value("Total")=values("Total")
dal.Table("Emp_Data").Update()
I have used this query and I am able to update the value but not able to get the value from table and add the new value in the table value.
Please help me to write the query in writing this.

Sergey Kornilov admin 3/29/2011

Virk,
if you have a valid 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.