Results 1 to 5 of 5
  1. #1
    4 Star Lounger
    Join Date
    Apr 2002
    Location
    Northern Territory, Australia
    Posts
    471
    Thanks
    16
    Thanked 0 Times in 0 Posts

    Remove blank fields from Report

    I want to run a report and where there is no record for a particular field I want to remove the whole line in report and the space it held be removed moving the next record up to take its place. In effect - if no data for that field in that record then no label or field to exist.

    Is this possible?

    All my research has come up with is the Can Grow Can Shrink function but that isnt getting rid of the label and the line.

    Kerry

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts
    The basic trick is to set the height of the text boxes to zero, and to have the Can Grow property set to yes. It makes working on the design and testing it a bit of a challenge, but we've used it successfully in a number of cases. The other possibility is to simply exclude the records that have no data in that field.
    Wendell

  3. #3
    4 Star Lounger
    Join Date
    Apr 2002
    Location
    Northern Territory, Australia
    Posts
    471
    Thanks
    16
    Thanked 0 Times in 0 Posts
    Thanks Wendell
    The plan is to print all the records (75) from this report. This is an alternative solution to merging in Word.
    The records with no data are pretty random so I cant go down that road.
    The Can Shrink Can Grow idea you suggest doesn't remove the labels though.
    Is there a way to do this with code?

  4. #4
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts
    One option would be to change the Labels to text boxes, and set them to null if the condition that makes you want to hide the record is true, the desired text if not null, and also make them zero height. However it seems to me that if the Labels are associated with the specific text box, and are set to zero height, then they don't print either - but it's been a long while since I did this sort of stuff. Are your labels associated with the text box.

    After further thought, is this associated with your prior thread and the hyperlinks issue? If so, hyperlinks on an Access report won't be active in general, so that may not meet your needs. And it looks like you are burning the midnight oil on this for sure!
    Last edited by WendellB; 2015-02-11 at 10:08. Reason: Include hyperlink issue
    Wendell

  5. #5
    4 Star Lounger
    Join Date
    Apr 2002
    Location
    Northern Territory, Australia
    Posts
    471
    Thanks
    16
    Thanked 0 Times in 0 Posts
    I solved my problem! I created a sub report and inserted it into the report. It worked perfectly in my horizontal report layout.

Posting Permissions

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