hello all
i have a database all the tables is connected with the sql server and i have 2 tables the first one is like that :
Name of Table : dbo_tbl_debthimself
====================
Code | qty | price | Total
====================
and the second once is like that :
Name of Table : dbo_tbl_edit_money
===============
Code | price | date
===============
i make the form for the second table i want to calculate the price lest's say when the user input the code and price from dbo_tbl_edit_money it will be calculate with the total from dbo_tbl_debthimself lets say : the our total is is (1000) when the user input the price form dbo_tbl_edit_money it will be like this : price - total
and this is my code :
in the same time it doesn't do the calculate and it doesn't have the error , please help me thanks ...... regards
i have a database all the tables is connected with the sql server and i have 2 tables the first one is like that :
Name of Table : dbo_tbl_debthimself
====================
Code | qty | price | Total
====================
and the second once is like that :
Name of Table : dbo_tbl_edit_money
===============
Code | price | date
===============
i make the form for the second table i want to calculate the price lest's say when the user input the code and price from dbo_tbl_edit_money it will be calculate with the total from dbo_tbl_debthimself lets say : the our total is is (1000) when the user input the price form dbo_tbl_edit_money it will be like this : price - total
and this is my code :
Code:
Dim rs As Recordset
Dim rs1 As Recordset
Dim a As Integer
Set rs = CurrentDb.OpenRecordset("dbo_tbl_edit_money", , dbReadOnly)
Set rs1 = CurrentDb.OpenRecordset("dbo_tbl_debthimself", , dbReadOnly)
While rs1.EOF = False
If rs1!code = c0.Column(1) Then
rs1.Edit
a = rs1!Total - Text217
rs1!Total = a
rs1.Update
Else
End If
rs1.Move 1
Wend
rs.AddNew
rs!name = c0.Column(0)
rs!code = c0.Column(1)
rs!price = Text217
rs!date = Text22
rs.Update
in the same time it doesn't do the calculate and it doesn't have the error , please help me thanks ...... regards