Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2009

    Unanswered: Checking a "sum()" field is updated before checking it?

    Hi. I've got a form with a subform in it. The subform shows multiple records (continuous), has a field called "amount", and at the bottom a textbox that is =sum([Amount]). All I want is when closing the form that it checks the sum([Amount]) field.

    Problem is, if I am updating a record, the sum box only updates after I click away from that record and it updates the record. If I close the form while the record is still "dirty", the sum box hasn't updated yet.

    i have tried "Me!AllocationsSubform.Form.Dirty = False", but it still doesn't refresh the sum box.

    Is there any way to do this?

  2. #2
    Join Date
    Jan 2009
    Kerala, India

    Checking a "sum()" field is updated before checking it?

    Write the following statement in the Amount_LostFocus() Event Procedure of the Sub-Form:

    Private Sub Amount_LostFocus()
    End Sub
    You can update the Amount Field and press Tab key to leave out of the Field and that action will update the Footer Summary Control with the above Statement. (Learn MS-Access Tips & Tricks)
    Learn Advanced MS-Access Programming with sample VBA Code.

    All responses are based on Access 2003/2007

Posting Permissions

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