• Blank Fields in Report

    Author
    Topic
    #354447

    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?

    Viewing 0 reply threads
    Author
    Replies
    • #520765

      You want to suppress the entire record that contains the blank field(s)?
      We’ll need a little more information… shrug

      • #520784

        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).

        • #520801

          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! wink

          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.

          • #520893

            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.

            • #520959

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

    Viewing 0 reply threads
    Reply To: Blank Fields in Report

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: