Results 1 to 4 of 4
  1. #1
    S2000magician is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jul 2019
    Posts
    31

    Adding tabs to a tab control dynamically

    I'd like to put a tab control on a form and have it be able to add tabs dynamically depending on what the user does. Is this possible? If so, how do I do it?



    To put this in context, I have a number of model portfolios which the user may want to change (i.e., sell some securities in a portfolio, purchase other securities). I would like to have a tab control with a tab for each portfolio that the user has changed. So, every time the user selects a different portfolio to change, I'd like it to create a new tab for that portfolio.

    Note that I cannot specify (statically) the number of tabs because it's possible that the number of model portfolios will change over time.

    Thanks!

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,412
    not possible to do - well you can but that involves the user going into form design to add a new tab. Not a direction you want to go.

    Consider having a listbox down the side or combo at the top for the user to select the portfolio required, rather than using tabs.

    you can create multiple instances of a form - still requires use of combo or listbox but you can view portfolios side by side. Easy to do in principle but depends on what you are doing to ensure actions on one instance of the form do not affect other instances - generally requires a higher level of understanding of how access works, an undertanding of object orientation programming and an understanding of class modules.

  3. #3
    S2000magician is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Jul 2019
    Posts
    31
    Thanks, Ajax.

    I think.

  4. #4
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,407
    s2000-davegri-v01.zip

    Have a look at this example. It's a bit different approach in that it will not create new tabs, but will let you assign forms to existing tabs.
    Form has 3 tabs, initially empty.
    Form has 3 combo boxes, allowing you to select a form to place on each tab. The tab captions change to identify the form.

    The example forms to place on the tabs are frmValue, frmRetirement, frmAgressive

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

Similar Threads

  1. Replies: 8
    Last Post: 10-24-2016, 08:31 AM
  2. Dynamically Controlling Document Tabs
    By tmartin in forum Access
    Replies: 3
    Last Post: 04-26-2015, 11:04 AM
  3. Replies: 3
    Last Post: 01-24-2014, 03:33 PM
  4. Replies: 4
    Last Post: 05-14-2013, 08:51 PM
  5. Option Control to hide/show page tabs
    By tandridge in forum Forms
    Replies: 3
    Last Post: 12-08-2011, 10:15 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