Results 1 to 3 of 3
  1. #1
    gg80 is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Jul 2010
    Posts
    328

    Populate a Parent form field from subform total

    I have a continuous subform with a list of items that are be selected with check boxes. A header control called “AddersTotal” shows the sum of the value of the items selected. On the subform After Update event, I would like the "AddersTotal" to populate a field in the parent form called “Accessories “ so that I can store the value and use it other places.

    I have tried the code me.parent.Accessories=me.AddersTotal for the After Update event of the subform. The field Parent.Accessories will show the old total, not the new total. If I precede the code with Form.recalc, the Parent field shows 0. At times, I get an error message “data has been changed” .



    I must be missing something fundamental about what “After Update” means. I have searched on the web but found only one lengthy discussion that ended in failure plus some things that make me think that the above should work. Any help much appreciated.
    I am using W7 with A2007

  2. #2
    slave138's Avatar
    slave138 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Oct 2010
    Location
    WI
    Posts
    233
    I would probably put the code into the OnClick event for the check boxes. Check the value of the checkbox to determine if it is selected or not, then adjust the totals and update the parent.

    If you want to upload a sample version of your DB I can probably help you solve your problem.

  3. #3
    gg80 is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Jul 2010
    Posts
    328
    Hi and thanks. I seem to have had some other problems with the form, but once straightened, I started code from the check box and works consistenly now. I have a quantity item that changes the total also. For that one, for some reason, I have to put a form.recalc and a form.refresh in front of code or I get the error message that data has been changed. Thanks again

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

Similar Threads

  1. Replies: 3
    Last Post: 10-05-2009, 07:22 AM
  2. Parent/Child subform
    By Jerry8989 in forum Forms
    Replies: 1
    Last Post: 09-18-2009, 07:27 AM
  3. Replies: 0
    Last Post: 06-23-2009, 03:01 PM
  4. Replies: 2
    Last Post: 05-22-2009, 01:07 PM
  5. SubForm to Parent
    By henryclay in forum Forms
    Replies: 2
    Last Post: 11-15-2006, 09:44 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