Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2008
    Posts
    23

    Unanswered: Button to Add/Remove tabs on a tab control

    How would I program a button to add/remove tabs on the tab display control? The user wants a screen that will allow them to change the number of tabs they are going to use on each screen they go to.

    The help screens for the tab control mention that tabs have to be added in design mode. Does this mean it can't be done on the fly?

  2. #2
    Join Date
    Feb 2004
    Location
    Chicago, IL
    Posts
    1,312
    I think you could do it on the fly, but I think you will have to do it from a different form. The button on the second form would open Form1 in design view, add the page and then save Form1.

    A problem with opening a form in Design View is in a multi user environment, it doesn't work real well. If the user did not open the database exclusively then he will not be able to save the changes to Form1.

    You might try adding several extra pages that are not visible, then when the user wants an additional page, then unhide it. You will have to store the user's preference and then unhide the appropriate number of pages, otherwise the Visible property is only temporary.

    What are you trying to accomplish with this feature? Maybe there is another way it could be done.

  3. #3
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Yup, make enough tab controls in design view and then hide/unhide them using code. That's what I would be doing
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  4. #4
    Join Date
    Mar 2008
    Posts
    23
    Thanks!!! :-) I wondered about closing the form, adding the tab page, then reopening it. The multi-user issues didn't occur to me. That'll be good to keep in mind. I think the hide/unhide idea sounds really good. Not sure at this point how many tab pages they'd need, but I'm sure it wouldn't be a huge amount.

    Once a tab page exists I'm thinking you could add a control or remove one on the fly without going into design mode. I haven't tried anything like that yet. And am new to using tab controls.

    Actually, I'm used to doing things with Access in ASP and am now working with only Access. I don't have a huge amount of experience with forms and reports in Access. It's kinda "fun" though.

  5. #5
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    I'm the reverse, I've used native access heavily since it was released, but haven't done much in ASP at all.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  6. #6
    Join Date
    Mar 2008
    Posts
    23
    It's actually been a while since I worked with Access much at all. I was working for a group that did SGML for the past 3 years. Now I'm back doing Access stuff. It's much more pleasant.

    I kind of like ASP over working with the Access reporting tool. I really don't like reports in Access. I'm pretty much stumbling around with the screens, but I should get the hang of it.

    There are a lot of things more likeable about doing ASP over the Access screens, but there were just as many things in ASP that were not near as good also. Working with HTML can be pretty painful at times. The controls aren't as nice at all. From what I've gathered .NET has improved on that a lot, but I've also heard some horror stories about it too. Then there's web services/XML stuff. Seems like that will be better a couple genereations from now maybe. (?? )

    Just a little rambling. Sorry.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •