Results 1 to 4 of 4
  1. #1
    krag is offline Medium experience
    Windows 7 32bit Access 2013
    Join Date
    May 2014
    Posts
    75

    Question Cross Calculations within sub-forms with "On Current" event


    I have a parent form with 5 different sub-forms. Only 2 of the sub-forms have parent-child link. Others have independent calculation formula for these 2 sub-forms. One sub-form has several records and for each record calculation is done on other sub-forms. I have programmed the linking calculation through event procedure for "On Current" of the multi-record sub-form.
    When the parent form is opened, I get a error message on the linking program, not finding the linked fields in other sub-form. I think it is because of sequence of timing of opening each sub-form within parent form.
    Is there any way to control the sequence of opening of child forms in parent form?

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    It sounds as though the subform that is causing the error should not have a value in its Main/Child link properties. If you are programmatically adjusting the Subform's Recordset/Filter properties, there should not be a need for a Main/Child Link

  3. #3
    krag is offline Medium experience
    Windows 7 32bit Access 2013
    Join Date
    May 2014
    Posts
    75
    Hi ItsMe
    I have checked it is not related to parent-child link. The error appears only when I open the form first time. If I proceed by cancelling the error and navigate through the records in the sub-form, it works fine without any errors.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    What is the exact error message?

    What do you mean by 'linking calculation'?

    You could leave the subform container controls SourceObject property blank and then set that property for each with code behind the main form, perhaps in the Load event.
    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.

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

Similar Threads

  1. Replies: 8
    Last Post: 07-15-2014, 05:56 PM
  2. Replies: 2
    Last Post: 01-15-2014, 07:57 PM
  3. "On Current" event and ActiveX controls
    By beru777 in forum Programming
    Replies: 7
    Last Post: 12-20-2011, 10:32 AM
  4. Replies: 7
    Last Post: 01-19-2011, 10:39 AM
  5. Replies: 21
    Last Post: 06-03-2009, 05:54 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