Results 1 to 2 of 2

Thread: [RESOLVED] Updating problems..!!!

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2005
    Posts
    185

    Resolved [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:
    1. Private Sub cmd_update_Click()
    2.  
    3. Dim z As Double
    4.  
    5. z = rst.Fields("Qty") - txtqty.Text
    6. rst!Qty = z
    7. rst.Update
    8.  
    9.  
    10. 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

  2. #2
    Fanatic Member kaffenils's Avatar
    Join Date
    Apr 2004
    Location
    Norway
    Posts
    946

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width