Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2004

    Unanswered: Update problem after new record

    Hi, I have a database into which order are entered. On this particular form the user enters the order info, then in a subform they can enter the items on the order. There is a hidden textbox on the suform that calculates the total value of the order with Quantity*Price. When they're done, they click the Add Order button.
    This button (among other things) is supposed to copy the value from the hidden textbox into the TotalValue field for that order. It does this, but the value is never right...because the user clicks it immediately after entering the Qty/Price for the last item, Access does not include the value for the last item in the Sum total, because the record is still being edited according to it (ie the user will enter the Price for the last item, then click the button start away, meaning that record still has focus).
    I have tried using SetFocus to move the focus away from the record when the Add Order button is clicked, and I've tried requerying the hidden Sum field after the button is clicked (since presumably, once the button is clicked, the record no longer has focus and the total value should be updated) but neither work. This is driving me crazy, can anyone help?

  2. #2
    Join Date
    Aug 2002
    Melbourne, Australia
    Have a look at my attached sample, this is how I do it and you don't need a "Button" to copy it. It will update upon change.

    If it is not exactly what you want you may give you some ideas.
    Attached Files Attached Files

    John A

  3. #3
    Join Date
    Oct 2004
    Perfect mate, thanks for the help :-)

Posting Permissions

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