Results 1 to 5 of 5
  1. #1
    Neobeowulf is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Nov 2013
    Posts
    5

    AfterUpdate for a subform to a subform

    Team,

    I'm trying to figure out how to update a subform based of another subforms update. In the attached database, if you look up the user "Jones" you can see the Customer Items subform and the Weekly Total subform. How do I get the Weekly total subform to update once I edit any of the fields in the customer items subform? If there's a smarter way to get & display these totals, i'm open to ideas.



    Additionally, the customer items subform is filtered by week based on the date entered, as is the weekly total subform.
    Attached Files Attached Files

  2. #2
    Neobeowulf is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Nov 2013
    Posts
    5
    Okay I figured out a solution. On the subform the inputs are put into, I made a macro in the afterupdate block of the date entered control. From there I just told the macro to OpenForm --> Input Form with the same filter name as the original form [Customer ID]

  3. #3
    Neobeowulf is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Nov 2013
    Posts
    5
    Okay that didn't work after all.

  4. #4
    lfpm062010 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2013
    Location
    US
    Posts
    415
    Try this code below (textbox "Bulk_Item" in form "Customer Items subform" and "AfterUpdate" event). It will show the current "Bulk Item" count.

    Word of caution: The "Refresh" command will auto commit your current record. So, if the record has no date entered, it will be not be displayed. You can only find the record in the table view.

    Private Sub Bulk_item_AfterUpdate()
    'Forms![InputForm]![Weekly total query subform].Requery
    Forms![InputForm].Refresh
    End Sub

  5. #5
    Neobeowulf is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Nov 2013
    Posts
    5
    Very happy with that result. Mucho gracias for the assist.

    I changed it from the bulk item to the date entered. Since the date entered is most likely the last entry of the form, it's perfectly fine that once a date is entered the form commits to record. In the event no date is entered, the save and close button is set to requery the combo box on the main form so the record will show.

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

Similar Threads

  1. Replies: 1
    Last Post: 12-03-2012, 02:45 PM
  2. Replies: 4
    Last Post: 10-08-2012, 05:33 PM
  3. Replies: 2
    Last Post: 06-09-2012, 01:56 AM
  4. Replies: 6
    Last Post: 05-05-2012, 08:43 AM
  5. AfterUpdate event won't refresh subform!
    By Remster in forum Forms
    Replies: 16
    Last Post: 11-26-2010, 10:06 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