Results 1 to 3 of 3
  1. #1
    Rickochezz is offline Advanced Beginner
    Windows 10 Access 2013 64bit
    Join Date
    Apr 2016
    Posts
    45

    Updating Subform when other Subform of Main Form is updated

    Hello All:



    I honestly try and try to figure these things out for myself but after banging my head for so long reading forums and trying all kinds of things it is now time to reach out.

    I will try to initially explain my issue and see where we go from there.

    I have one Form - frmStudentRevenue with two subforms - frmfees and frmpayments.

    frmFees -- The Total at the bottom of the form works great in summing the amount column.

    frmStudentRevenue -- There is a hidden text box that displays the Total text box from frmFees.

    frmPayments -- The Total at the bottom of the form also works great in summing the amount column.

    When the Form is loaded the Outstanding balance produces the proper amount -- Total of frmPayments - Total of frmFees (though frmStudentRevenue).

    Any changes made on the frmPayments Amount produces the correct result.

    The Refresh button also produces the correct results.

    My problem comes when I need to Add/Delete/Change a Fee Amount from the frmFees.

    The Total of frmFees and frmStudentRevenue change but the Outstanding balance on frmPayments does not.

    I'm at the point now where I have the After Update trigger event attached to the amount on frmfees

    Private Sub Amount_AfterUpdate()
    Forms!frmStudentRevenue.frmPayments.Form.Requery
    End Sub

    Now what happens is that when I change a value on frmfees the Outstanding balance does not update until I make another change.

    So I think that I am close but just can't figure out where I need to attach the trigger and what to attach to this trigger.

    Thanks in advance



    Click image for larger version. 

Name:	Revenue.jpg 
Views:	12 
Size:	125.2 KB 
ID:	25148

  2. #2
    Rickochezz is offline Advanced Beginner
    Windows 10 Access 2013 64bit
    Join Date
    Apr 2016
    Posts
    45
    Both frmFees and frmPayments are linked to the frmStudentRevenue

    Link Master Fields: StudentID
    Link Child Fields: StudentID

  3. #3
    NTC is offline VIP
    Windows 7 64bit Access 2013
    Join Date
    Nov 2009
    Posts
    2,392
    first to debug this - make all controls visible temporarily. Use the sub forms only to sum their data. Call the sub form total(s) to fields/controls on the main form (I think you have already) Do all the math on the main form. Don't do any of the math in the sub forms (except summing their data).

    You probably still will need to force text box Balance on the main form to requery.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 11
    Last Post: 02-22-2015, 01:25 PM
  2. Replies: 4
    Last Post: 12-29-2014, 01:53 PM
  3. Replies: 1
    Last Post: 07-18-2014, 04:11 AM
  4. Replies: 3
    Last Post: 11-04-2012, 09:25 AM
  5. Replies: 5
    Last Post: 12-26-2011, 07:52 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums