Results 1 to 6 of 6
  1. #1
    Lounger
    Join Date
    Mar 2001
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Blank Fields in Report

    I have 4 fields in the table. If one or more of these fields is blank, I want to suppress the blank fields in the report. How do I do that?

  2. #2
    4 Star Lounger
    Join Date
    May 2003
    Location
    Austin
    Posts
    401
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Blank Fields in Report

    You want to suppress the entire record that contains the blank field(s)?
    We'll need a little more information... <img src=/S/shrug.gif border=0 alt=shrug width=39 height=15>

  3. #3
    Lounger
    Join Date
    Mar 2001
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Blank Fields in Report

    Sorry, this is my first post, and I think I forgot some important information.
    Using Win98SE and Access 2000.
    Fields 1 through 4 contain a single character. Example: Field 1 is A, field 2 is B, field 3 is h, and field 4 is M. Field 1 is always filled with a character (A through M). Fields 2 through 4 can contain a character (also A through M) or can be blank.

    The reports looks like:
    Persons Name
    Field1
    Field2
    Field3
    Field4
    Then a line to separate this record from the next one.

    If fields 3 & 4 are blank, I want the line to move to a position below field 2 (i.e., supress blank lines).

  4. #4
    4 Star Lounger
    Join Date
    May 2003
    Location
    Austin
    Posts
    401
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Blank Fields in Report

    Quick and dirty way:
    Use a label wizard
    redefine the label to have 1 across
    Drop each field in their respective place
    (i.e. one after another-in column fashion)
    [ENTER after each field entry]
    Sort by Name
    Sort by Field1 (if needed)

    The code generated will be:
    =Trim([Field2])
    =Trim([Field3])
    =Trim([Field4])

    This replaces the blanks with the next non-null field
    Add a Custom Report Header-Instant Report!!
    It's realllly ugly but it'll work-right now! <img src=/S/wink.gif border=0 alt=wink width=15 height=15>

    If you need actual report functionality (i.e. math), I'm sure one of the mavens here can help you more. This is coding #101 for most of them.

  5. #5
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Blank Fields in Report

    This is fairly simple and you can do it without code. Make the height of each of the controls bound to Field1, Field2, etc., zero height or close to it and move them up close beneath one another. Put your line beneath the bottom control and move the footer of the detail section up so that you have only enough room to hold the stacked controls, the line and the space you want to see after the line. Make sure the controls don't overlap.

    Set the CanGrow property of each control to True and set the CanGrow property of the detail section likewise. When you run the report, the controls will only expand if there is data in them and will push any other controls, like the line, down as they expand.
    Charlotte

  6. #6
    Lounger
    Join Date
    Mar 2001
    Posts
    37
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Blank Fields in Report

    Thanks for the information. We're trying your suggestions and first results look very promising. Thanks again.

Posting Permissions

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