okay lets see what we can do
lol. so you get the data from the product id. you are updating the table with the values in txt boxes? if that is the way your are working it lets try this.
rs1.Open "UPDATE Stock (qty, stock_date, trans_type, qtydb ) Values (" & qtyfield &", " & stock_datefield &", " & trans_type &", " & qtydbfield &")", updatedb
been a long day hope that works lol
Hi Professor P
Thanks for your help, it's truly appreciated.The update actually works, but then the problem is that it does'nt update the value corresponding with the product_id, instead it updates all the all the values here is the code I'm using:
db.Open "DSN=eco;Password=andile;User ID=eco;Data Source=waterdb"
Set rs = New ADODB.Recordset
rs.Open "select product_id,qty,qtydb from product_line where product_id=" & Me.productid.Text & " ", db
Do While Not rs.EOF
If productid = rs!product_id Then
Set updatedb = New ADODB.Connection
updatedb.Open "DSN=eco;Password=andile;User ID=eco;Data Source=waterdb"
Set rs1 = New ADODB.Recordset
qtydba = qtydba + qty
updatedb.Execute "UPDATE product_line set qtydb=" & qtydba & "", updatedb
Else: MsgBox ("invalid product_id")
rs.Close
End If
Loop
db.Close
Could you please help.
Thanks.