Results 1 to 5 of 5
  1. #1
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    2,097

    Defer opening of a sub-form until main form "is ready"

    I have a sub-form that needs contents of its OpenArgs to be set. How do I suppress the opening of the sub-form until the main form has reached a state where the required OpenArgs can be set?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Don't set the subform container control SourceObject property in design. Load it with code behind main form.

    Why is subform OpenArgs dependent on main form "is ready"?
    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
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    Quote Originally Posted by GraeagleBill View Post
    I have a sub-form that needs contents of its OpenArgs to be set. How do I suppress the opening of the sub-form until the main form has reached a state where the required OpenArgs can be set?
    You cannot. The subform opens and loads first, then the main form. The main form unloads first, then the subform.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  4. #4
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    2,097
    Don't set the subform container control SourceObject property in design. Load it with code behind main form.
    Thanks, that will work fine.
    Why is subform OpenArgs dependent on main form "is ready"?
    The sub-form needs a date that the main-form determines. The sub-form isn't visible until it's called. Strictly a UI consideration.
    Thanks,
    Bill

  5. #5
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    2,097
    The subform opens and loads first
    Yes, I forgot about that!

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

Similar Threads

  1. Making sub form unique to client's "main" form
    By PATRICKPBME in forum Forms
    Replies: 10
    Last Post: 12-02-2019, 09:17 AM
  2. Replies: 1
    Last Post: 04-26-2016, 05:24 PM
  3. Replies: 1
    Last Post: 09-07-2015, 08:00 AM
  4. Replies: 1
    Last Post: 12-10-2013, 12:59 AM
  5. Replies: 2
    Last Post: 11-26-2012, 11:12 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