Results 1 to 4 of 4
  1. #1
    gemadan96 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Oct 2012
    Posts
    110

    Requery subform after update of main form

    I have a form "Registrations" based on a query called "Registrations Extended". On it are a series of check box controls for various events the registrant can participate in. The query calculates the total number of events checked. The number is displayed in a text box control and updates when ever an event is checked or uncheched. Also there are a handful of text box controls for the user to enter a quantity for the various materials available for purchase. There is also a subform, "Fees subform" based on another query that calculates the fees based on events and materials ordered. It also shows the amount paid and the balance due.



    I want the values displayed in the "Fees subform" to update as events are selected/deselected and the material quantities are changed. It updates if I refresh by hitting the F5 key, however, the ultimate users of the database will find that inconvenient and most likely confusing. So I need to automate this.

    I have tried, unsuccessfully, using requery in macros and VBA for various events including After update, On click, etc.

    Any suggestions?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Why unsuccessful, what happens - error message, wrong results, nothing?

    Post code for analysis or provide db by following instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    gemadan96 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Oct 2012
    Posts
    110
    Nothing happened.

    I've attached a copy of the database.

    The main form is Registration and the subform is Fees subform.

    On the main form the items under Events and Materials are the ones that change. When they change I want the values under fees to update accordingly.

    I've been working with the control "Extreme Forms" under events. Figuring if I can get one to work then the rest will be easy.

    I've tried for the After Update event they following VBA code:

    If Me.Dirty Then Me.Dirty = False

    Also it was suggested to try: Me.Controls("Fees subform").Form.Requery
    Attached Files Attached Files

  4. #4
    gemadan96 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Oct 2012
    Posts
    110
    I've found a solution.
    I created a macro that saves the record after a checkbox or quantity field is changed then requeries the subform. I then saved the macro and named it Update Fees. Then for each control that can be changed I selected the Update Fees macro for the After update event. It works. it may not be the easiest or optimal way, but it works.

    Of course if someone suggests another way I'll consider it.

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

Similar Threads

  1. Replies: 1
    Last Post: 07-20-2012, 09:48 AM
  2. Replies: 3
    Last Post: 04-17-2012, 10:28 AM
  3. Replies: 3
    Last Post: 03-11-2012, 08:24 PM
  4. Replies: 3
    Last Post: 10-10-2011, 06:33 PM
  5. Replies: 6
    Last Post: 01-13-2010, 02:41 PM

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