Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2002
    Location
    Island of Dots
    Posts
    316

    Unanswered: DSum and SubForm problems

    I have a main form (frmDataEntry) with a continuous subform within it (fsubJobDetails). Each is based on a separate stored query - qryDataEntry and qryJobDetails resepctively. In frmDataEntry I have a control (txtGrandTotal) with the following control source:

    =DSum("[Planned Premier Hours]","[qryJobDetails]")+DSum("[Non Chargable Hours 1]","[qryJobDetails]")+DSum("[Non Chargable Hours 2]","[qryJobDetails]")

    It is meant to show the grand total of all the specified records in qryJobDetails - 'Planned Premier Hours', 'Non Chargable Hours 1', and 'Non Chargable Hours 2'. It does work for the first record viewed in frmDataEntry, but when the focus moves to another record, txtGrandTotal remains the same. The same also happens if you change any of the values in fsubJobDetails (and therefore qryJobDetails). I need txtGrandTotal to update for each change made to any of the source fields, and when focus changes to another record.

    I suspect I need to save the data in the queries back into the underlying table, but I tried F![frmDataEntry]![fsubJobDetails].Requery from within frmDataEntry but to no avail.

    Any help greatly appreciated.

  2. #2
    Join Date
    Aug 2002
    Posts
    4
    Have you tried to refresh the form after changing data records rather than requery

    Steve

  3. #3
    Join Date
    Jul 2002
    Location
    Island of Dots
    Posts
    316
    Hi

    Yes, I tried Refresh, but that had no effect either. Anyway, I have made some substantial redesigns to the way the form(s) fuctions, and it works now. Basically, I had to change it so that the AfterUpdate event in the value fields in the subform initiated a requery to the main form, which causes all the data to be saved and the Grand Total to be updated.

Posting Permissions

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