[RESOLVED] Updating problems..!!!
Dear Experts,
I am using ADO, creating a word VBA integrated with Access 2003...I just want to know and need your help please....what is going on with my code:
VB Code:
Private Sub cmd_update_Click()
Dim z As Double
z = rst.Fields("Qty") - txtqty.Text
rst!Qty = z
rst.Update
End Sub
when I mouse over on rst.Fields("Qty") it has "5" value and for "txtqty.Text" it has "2" value all are integer....
Why if I did mouse over on "z" (at z = rst.Fields("Qty") - txtqty.Text) why it was "0" value...it suppose to have "3" value....and it will updated the Qty field as "3" as a new value on the access....
Anyone could help me please...???...What is wrong with this..???
Thank you very much...
Jennifer ;)
Re: Updating problems..!!!
The z value has not been set when the debugger is on the z = rst.Fields("Qty") - txtqty.Text. The line must be executed first. Check the z value when debugger reaches the rst!Qty rst!Qty = z line.