Results 1 to 2 of 2
  1. #1
    deepanadhi is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2012
    Posts
    22

    Hide Columns in Query Result based on Text Box Value

    Hi All,



    As a Result of a query i ll get around 15 columns in the output.
    Out of which I need to display First 5 columnns all the time & The One among the rest 10 columns depending upon the value entered in the Text box.

    The connection is pretty simple.
    If "1" is entered in the text box and Button is pressed, First 5 columns should be dislayed and the 6th Column shud be displayed, and rest should be hidden from the view.
    If "2" is entered in the text box and Button is pressed, First 5 columns should be dislayed and the 7th Column shud be displayed, and rest should be hidden from the view.

    and so on
    If "10" is entered in the text box and Button is pressed, First 5 columns should be dislayed and the 15th Column shud be displayed , and rest should be hidden from the view.

    Need help in VB coding to acheive this,
    Thanks in advance...


    - Deepan

  2. #2
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    I don't know if this is the most elegant way to do this, but in the On Click Event, you could use a Case Statement and then for each possible selection in the Text Box - create the appropriate SQL string.

    Where are you displaying this data?

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

Similar Threads

  1. show / hide columns based on criteria?
    By stevepcne in forum Access
    Replies: 1
    Last Post: 11-18-2011, 02:49 PM
  2. Replies: 1
    Last Post: 09-28-2011, 09:48 PM
  3. Replies: 6
    Last Post: 02-24-2011, 03:24 PM
  4. Show/Hide Columns in a Query
    By SCFM in forum Access
    Replies: 1
    Last Post: 02-23-2010, 08:04 AM
  5. Query result based upon two field conditions
    By diane802 in forum Access
    Replies: 35
    Last Post: 01-08-2010, 06:31 PM

Tags for this Thread

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