Results 1 to 6 of 6
  1. #1
    EddieN1 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    316

    Identifying the Parent Page in a subform

    I have a subform that is used in two different pages in the parent form. Each page uses different criteria for the subform. Is there a way I can tell, in the subform, which parent page is active? Thanks, Eddie

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Don't think I've ever used pages in form. Want to provide db for analysis? Follow 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
    EddieN1 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    316
    I wasn't clear with my terminology... Pages are what you get when you insert a Tab Control. Access refers to each tab as a page. I have a Form with several tabs and some of these have subforms in them. In my case, I want to use the same subform in two different tabs/pages, but I want to subform to have different filters depending on the tab/page that's active.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Okay, that's different. I do use tab controls but never had to determine which page has focus. The tab page has a Click event but doesn't seem to do anything when I tested code nor does the tab control Click event. Annoying.

    Maybe try the OnEnter event of the subform container control to run code that sets subform filter. Do these subforms have Master/Child linking to main form?
    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.

  5. #5
    EddieN1 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    316
    I am going to remove this post because the whole idea is a bad one. If I have the same form loaded as subforms more than once at the same time, the forms interfere with each other. It's like when I try to load it the second time, Access identifies that it's already loaded and just passes control to it... not what I need. Then, when I open the same form as a main form, it is really another instance of the one subform. So, I plan to clone Form1 as subform1 and subform2, then use subform1 as the subform under one tab and use subform2 as the subform under the other tab. The only downside to this is if I change Form1, I have to remember to save it as subform1 and subform2 and change the filters. Thanks for everyone's help. Eddie

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Apparently there is a way to open multiple instances of same form - I've never used it. Don't know if it is relevant to your situation. Review http://allenbrowne.com/ser-35.html

    Forum doesn't usually remove threads unless they are offensive or spam or some other strong justification. This discussion might actually benefit someone else so think it is worth retaining.
    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. Subform with multiple parent forms
    By mwc0914 in forum Forms
    Replies: 8
    Last Post: 03-12-2013, 06:17 AM
  2. Replies: 2
    Last Post: 01-08-2013, 12:56 AM
  3. Replies: 2
    Last Post: 09-16-2011, 06:11 PM
  4. Parent/Child subform
    By Jerry8989 in forum Forms
    Replies: 1
    Last Post: 09-18-2009, 07:27 AM
  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