Results 1 to 4 of 4
  1. #1
    focosi is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    97

    Combobox-dependent show/hide controls

    Shortly, my form has 3 checkboxes and 1 combobox. I would like chechbox to be shown only when a given value is selected in the combobox. Any code to achieve this ?


    Thx

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    focosi is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    97
    Great link Paul, thanks a ton!
    and the code also works at hiding labels !

    Now I have one more trouble: the same show/hide behaviour should apply to more than one value in the combobox. Since it seems to me that only a single "If" statement can be created on a given control, how can I list the values with same behaviour ??? I have tested the following without any success

    If Me.ControlName = "Whatever", "Whatever 2" Then

    If Me.ControlName = "Whatever"; "Whatever 2" Then

    If Me.ControlName = "Whatever" Or "Whatever 2" Then

  4. #4
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    You could also try to use Case Select

    Look here to see how that works.

    http://www.databasedev.co.uk/select-case-statement.html

    http://www.techonthenet.com/access/f...anced/case.php

    Alan

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

Similar Threads

  1. Combo Box value hide/show Image
    By alyon in forum Access
    Replies: 7
    Last Post: 12-13-2012, 09:48 AM
  2. Replies: 5
    Last Post: 07-29-2011, 03:07 PM
  3. Show/Hide Form
    By sparlaman in forum Forms
    Replies: 5
    Last Post: 05-16-2011, 11:48 AM
  4. need help - combobox controls table?
    By RedGoneWILD in forum Programming
    Replies: 15
    Last Post: 09-07-2010, 04:50 PM
  5. Hide and show tekstbox
    By Patience in forum Access
    Replies: 3
    Last Post: 06-18-2010, 06: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