Results 1 to 8 of 8
  1. #1
    tallitin is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Feb 2014
    Location
    Sydney, Australia
    Posts
    4

    Post exclude some fields from a report depending on whether they contain data

    I want to produce a report based on a table (or query - could be either) that doesn't reproduce every single field in the report (or query). Whenever a field in a record has no data in it, I do not want it to appear in the report. How do I achieve this? Any help would be appreciated.

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Have you tried using the .Visible property? Maybe an If Then Statement would be appropriate.

  3. #3
    tallitin is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Feb 2014
    Location
    Sydney, Australia
    Posts
    4
    that sounds like a good idea. However the 'visible' property in the report property sheet only gives me the option of 'yes' or 'no'. Are you suggesting I should build some code into the control on the report? If so, should I use 'expression builder' to do this?

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    I would not use expression builder. Instead, I would use VBA to evaluate the field and then decide whether or not to set the Visible property to equal yes or No.

  5. #5
    tallitin is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Feb 2014
    Location
    Sydney, Australia
    Posts
    4
    Hey, thanks for that. Any idea what the Code should be?

    Quote Originally Posted by ItsMe View Post
    I would not use expression builder. Instead, I would use VBA to evaluate the field and then decide whether or not to set the Visible property to equal yes or No.

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Setting a control to not visible doesn't accomplish much. The control still occupies space and there will be blank area on report, no different from an empty field.
    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.

  7. #7
    tallitin is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Feb 2014
    Location
    Sydney, Australia
    Posts
    4
    Yes, I get that. Someone suggested the formatting of the report also needs an action applied to it so that it shrinks accordingly.

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Where will it shrink? Just because there are empty field(s) doesn't eliminate the record. The record still occupies space if only one field has data.
    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.

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

Similar Threads

  1. Exclude duplicate records when counting in a report
    By Fuzz_cozens in forum Reports
    Replies: 8
    Last Post: 02-14-2014, 02:16 AM
  2. Replies: 2
    Last Post: 10-03-2013, 02:02 PM
  3. Exclude columns with no data
    By Gee in forum Access
    Replies: 3
    Last Post: 03-21-2013, 02:40 PM
  4. Printing a report and exclude all data with 0
    By jwright77 in forum Reports
    Replies: 3
    Last Post: 08-30-2012, 02:03 PM
  5. Replies: 3
    Last Post: 09-11-2011, 06:38 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