creating a school directory. how do i get the report views to not show blank lines?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Shari Gottheim
    New Member
    • Aug 2010
    • 4

    #1

    creating a school directory. how do i get the report views to not show blank lines?

    creating a school directory. how do i get the report views to not show blank lines?
  • jimatqsi
    Moderator Top Contributor
    • Oct 2006
    • 1293

    #2
    In the detail OnFormat event, add

    If (some test) then docmd.canceleve nt

    The some test is however you can tell that the line will be blank. Something like If isnull(partnumb er) then...

    Jim

    Comment

    • Shari Gottheim
      New Member
      • Aug 2010
      • 4

      #3
      Jim, thank you. I am a real real novice. Not sure I understand the response. Can you be more specific. Thank you.

      Comment

      • jimatqsi
        Moderator Top Contributor
        • Oct 2006
        • 1293

        #4
        How do you know if a line is blank or not? What data field or flag tells you this line will be blank?

        Jim

        Comment

        • Shari Gottheim
          New Member
          • Aug 2010
          • 4

          #5
          I have a master data file that has data in it. Some data is blank, some not. When I lay out the report page, if the field is blank I want the data to appear as if nothing is missing in the report page. So, for example, I set the report design to be this:

          Child name
          address
          city, state, zip
          phone number
          parent 1
          parent 1 phone
          parent 1 email
          parent 2
          parent 2 phone
          parent 2 email

          So, if the data is missing for parent 1 email and parent 2 phone, I want the layout to look like this:

          John Doe Jr.
          123 Main Street
          Anytown, Anycity, 00000
          555-555-5555
          Mother John Doe
          555-555-5556
          Father John Doe
          email@email.com

          instead of

          John Doe Jr.
          123 Main Street
          Anytown, Anycity, 00000
          555-555-5555
          Mother John Doe
          555-555-5556

          Father John Doe

          email@email.com

          Comment

          • jimatqsi
            Moderator Top Contributor
            • Oct 2006
            • 1293

            #6
            So the report goes down the page like that, not across with each data item in a column? In that case you have to set the CanShrink property for each text box to Yes. You also need to change the CanShrink property for the Detail section.

            I'm not sure this will work if your phone numbers are of a numeric data type. If that's the case, we'll try something else.

            Jim

            Comment

            • Shari Gottheim
              New Member
              • Aug 2010
              • 4

              #7
              Thanks so much Jim. Didn't work though. Each text box has CanShrink and CanGrow set to yes. Properties of the detail section are set to yes as well. All the boxes are set to text so not numeric (I don't think). Also, note, these aren't queries. Anything else I can try?

              Comment

              • jimatqsi
                Moderator Top Contributor
                • Oct 2006
                • 1293

                #8
                It could be that you left some blank space under the last text box, or between the text boxes. The program is going to think that is intended to be there, regardless of what it does with the text boxes. So, first, I'd eliminate any space under any text boxes.

                Then, if that does not work you might try this:

                Code:
                if isnull(me!txtBox1) then
                   me!txtBox1.visible = false
                else
                   me!txtBox1.visible = true
                endif
                
                if isnull(me!txtBox2) then 
                  me!txtBox2.top= = me!txtBox1.top
                  me!txtBox2.visible = false
                else
                  me!txtBox2.top = me!txtBox1.top + me!txtBox1.height
                  me!txtBox2.visible = true
                endif
                
                if isnull(me!txtBox3) then 
                  me!txtBox3.top= = me!txtBox2.top
                  me!txtBox3.visible= false
                else
                  me!txtBox3.top = me!txtBox2.top + me!txtBox2.height
                  me!txtBox3.visible = true
                endif
                 
                '   and so on
                The if isnull(textbox) might have to change to
                if nz(textbox,"")= ""

                Jim

                Comment

                Working...