K
Kon
Please help me I stuck for hours trying to solve the bellow problem.
I have a form based in a table records of customers, prices, sign, code
The table has price, sign (1,-1), code (101till170)
I want an incremental residual of the price multiply sign to put in a new
control of the form named residual.
Generally I need to trap the previous residual and after some
comparisons to put in the current record
I used recordsetclone and functions in form control but nothing happened. I
need an example of code or
in wich event shall i put or do I have to make something else.
Please reply me.
I need to have some conditions (see the below code)
rs is just a recordset and residualold is the residual of the previous
record.
Do Until rs.EOF
If code > 104 And code < 134 Or code = 101 Or code = 102 Then
multi = price * sign
If residualold = residual And rs.BOF=false And code = 101 Or
code = 102 Then GoTo same
residual = residualold + multi
residualold = residual
Else
same:
residual = residualold
End If
rs.MoveNext
Loop
I have a form based in a table records of customers, prices, sign, code
The table has price, sign (1,-1), code (101till170)
I want an incremental residual of the price multiply sign to put in a new
control of the form named residual.
Generally I need to trap the previous residual and after some
comparisons to put in the current record
I used recordsetclone and functions in form control but nothing happened. I
need an example of code or
in wich event shall i put or do I have to make something else.
Please reply me.
I need to have some conditions (see the below code)
rs is just a recordset and residualold is the residual of the previous
record.
Do Until rs.EOF
If code > 104 And code < 134 Or code = 101 Or code = 102 Then
multi = price * sign
If residualold = residual And rs.BOF=false And code = 101 Or
code = 102 Then GoTo same
residual = residualold + multi
residualold = residual
Else
same:
residual = residualold
End If
rs.MoveNext
Loop