Results 1 to 3 of 3
  1. #1
    MHernan1 is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2012
    Posts
    18

    Query that returns only popluated fields in a record?

    Hi all,

    Was hoping you could point me in the right direction. What I would like to do is have a query the returns only the populated fields on a record. I have a database that i am working where there are numerous columns but I don't want the end user to have to see all the columns when they do a query, just those that have values. They would only need to query one record at a time.

    So for example:

    Table 1 has four columns: "OrderID", "Apples", "Oranges", "Pears". I run a query to find a particular OrderID and only want to see the columns that have values.



    Any help would be greatly appreciated.

    thanks!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,625
    Won't work. Filtering limits records, not fields. Query can't conditionally return/not return a field. Can't say 'If no data then don't include this field.'

    Why are users working directly with tables/queries? You can display the record on a form then use code to hide controls bound to fields if no data.

    Why would you want to do this anyway?

    You have columns actually named "Apples", "Oranges", "Pears"? Does not sound like normalized structure.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    MHernan1 is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2012
    Posts
    18
    thanks for the response, this exactly why i come here. I don't actually intend to have users editing the table directly, and it sounds like from your response I can accomplish what I need via a form. And no, those aren't the names of my actual columns, it was just an example I put out there.

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

Similar Threads

  1. Replies: 2
    Last Post: 04-10-2012, 12:30 AM
  2. CrossTab Query Max X Returns
    By systems013 in forum Access
    Replies: 5
    Last Post: 11-04-2011, 01:12 PM
  3. Report only returns 1 record unless run directly
    By teresamichele in forum Reports
    Replies: 3
    Last Post: 12-17-2010, 12:06 PM
  4. Query returns duplicates
    By RobRay in forum Queries
    Replies: 3
    Last Post: 10-26-2010, 01:38 PM
  5. Replies: 4
    Last Post: 09-21-2009, 01:51 PM

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