Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2003
    Posts
    9

    Question Unanswered: Hiding Query fields

    =IIf IsNull( Me!NameOfControl1) Then
    Me!NameOfControl1.Visible = False
    Else Me!NameOfControl1.Visible = True
    End if

    is it possible to run this code inside a query so that the query can run and if a criteria in the query=isnull then it will hide that field (not show it in the query output)?
    Attached Thumbnails Attached Thumbnails downloadnet.gif  
    Last edited by bobin32; 01-21-04 at 11:06.

  2. #2
    Join Date
    Oct 2003
    Location
    Canada
    Posts
    574
    Queries are not like forms where you can hide/show objects using vba. You cannot hide a column on the fly. You can edit your sql before it is run though, but the best solution is to have 2 queries: one that has the column and another that does not. Determine which should be run before hand.

    Columns on a query do not have a property called visible even though it seems like it does when you look at the Query by Example screen. That check box only determines whether or not that column will be included in the SQL.

  3. #3
    Join Date
    Oct 2003
    Posts
    9
    the thing is i would have to have up to 20 queries which would be too much. I only want it to be hidden from the report which the query will feed to.

  4. #4
    Join Date
    Sep 2003
    Posts
    11

    Unhappy

    yeah, i have the same problem. there just doesn't seem to be a tidy, easy way to do it.

  5. #5
    Join Date
    Sep 2003
    Location
    UK
    Posts
    13

    Please could you post the code

    Bobin32,

    are you automating download of files from the Internet? If so this is something I would like to be able to do. Please could you post your code?

    Regards

    sioma

Posting Permissions

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