Results 1 to 3 of 3
  1. #1
    Deutz is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Oct 2010
    Posts
    51

    User defined columns report


    Hi and thanks in advance,

    I am using Access 2010

    I have a single table that stores product information and I would like to build a report that gives the user the option to select the fields they want to see in the report. The db is shared so I can't open the report in design mode in code and show/hide textboxes/labels and move textboxes/labels to close up gaps etc. Wondering if there is a way to do it using the sql and the report's event procedures?

    Thanks
    Deutz

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,972
    Short answer - no. Field names cannot be dynamic in query. Either it's there or it isn't. Could use lots of VBA code to change a QueryDef to assign alias field names:

    SELECT fieldname1 AS Field1, fieldname5 AS Field2, ... FROM tablename;

    Then the report can have textboxes bound to Field1, Field2, etc. But what about data formatting, length, etc. Still need a static number of textboxes on the report. What if the report allows for 10 fields and user really wants 11?

    Suggest you design a standardized set of reports and users pick from a list or click buttons to choose.
    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
    Deutz is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Oct 2010
    Posts
    51
    Hi June7,

    I kinda thought that might be the case. Will build a set of reports as you suggested.

    Thanks
    Deutz

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

Similar Threads

  1. Replies: 7
    Last Post: 04-12-2014, 04:26 PM
  2. Replies: 13
    Last Post: 12-12-2013, 07:22 PM
  3. Replies: 3
    Last Post: 11-12-2013, 04:13 PM
  4. user-defined type not defined
    By markjkubicki in forum Programming
    Replies: 3
    Last Post: 05-09-2013, 05:15 PM
  5. Replies: 1
    Last Post: 12-14-2012, 12:32 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