Results 1 to 8 of 8
  1. #1
    Join Date
    Aug 2007
    Posts
    88

    Unanswered: how to use vba to hide partial form

    Hi Gurus,

    I have a access form (Form A) with 70 input text boxes. I would like to know if there is a way to use VBA code to hide partial form. My intention is the width or height of the form (Form A) will depend on a selection of a value from a combo box in the previous form (Form B). Based on the selection in form B, the form A only display 44 input text boxes or will display all 70 input text boxes, it also will change the width or height (hide partial form) based on how many input text boxes will be displayed.

    Thank you very much for help!

    NewGuy

  2. #2
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Wouldn't it be simpler to have two forms? Form B can open the appropriate one based on its selection.

    However, you can hide controls by setting their Visible property to False. You can modify the form's width by altering its Width property accordingly. One thing you cannot do is set the width of the form less that the objects on it... even if those objects are not visible.
    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

  3. #3
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    As I was reading your question I was just going to write wouldn't it be simplier with 2 forms but I see StarTrekker beat me to it.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  4. #4
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Yay!! I beat you for once

    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

  5. #5
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    .....or consider using a tabbed dialog, allocate controls there in logical groups.
    I'd rather be riding on the Tiger 800 or the Norton

  6. #6
    Join Date
    Aug 2007
    Posts
    88

    Thanks everyone!

    StarTrekker, pkstormy, Thanks for your help! two forms is a great idea. I have never thought of that. I did tried to use width to control, however, it did not work just like StarTrekker said.

    healdem, sorry for my limited knowledge in access. I don't know what's tabbed dialog, and how to allocate controls there in logical groups. However, I will look into that. Thanks!

    Newguy

  7. #7
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    Tabbed Dialog, is the TAB control
    you can have many tabs, only one of which is visible at one time

    say you form is a travel questionaire
    TAB 1 may be general stuff about the person being asked (eg name, address, age, sex and so on)
    TAB 2 is travel done by perosnal transport (eg Car, Bike, Cycle etc..)
    TAB3 is travel done on public transport locally eg bus & train
    TAB4 is long distance travel (eg plane, train etc....
    TAB5 is......
    so if someone doesn't use public transport, y'dont use TAB 3
    I'd rather be riding on the Tiger 800 or the Norton

  8. #8
    Join Date
    Aug 2007
    Posts
    88

    Thanks!

    Quote Originally Posted by healdem
    Tabbed Dialog, is the TAB control
    you can have many tabs, only one of which is visible at one time

    say you form is a travel questionaire
    TAB 1 may be general stuff about the person being asked (eg name, address, age, sex and so on)
    TAB 2 is travel done by perosnal transport (eg Car, Bike, Cycle etc..)
    TAB3 is travel done on public transport locally eg bus & train
    TAB4 is long distance travel (eg plane, train etc....
    TAB5 is......
    so if someone doesn't use public transport, y'dont use TAB 3
    Thanks a lot! Now I get it.

Posting Permissions

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