Form - compacting empty lines vertically.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John Baker

    Form - compacting empty lines vertically.

    Hi:

    I have a form which contains the following entry ( one element on each line)

    Name
    Address line 1
    Address line 2
    city, state, zip

    In many cases there is only ONE address line filled in (the other is for apartment numbers
    and things). The way the form works now, the name is followed by address line one
    (completed with data) and then a blank line followed by the city state and zip. It looks
    scattered and untidy.

    Is there any way to vertically compress this so that when a line is blank it does not
    appear or use a line on the form? This would make the form look a great deal tidier.

    Thanks

    John Baker

  • MacDermott

    #2
    Re: Form - compacting empty lines vertically.

    This is easily accomplished in a report, but not so easily in a form.
    Think of the form as the way to put the information in -
    you always want those blank lines to be available, in case someone has
    some more information to add.
    Think of a report as how you get the information out:
    that's where you do the tidy formatting.

    HTH
    - Turtle

    "John Baker" <Baker.JH@Veriz on.net> wrote in message
    news:ga3csvcjag bq2cs9al74j3eri 502dg0aq2@4ax.c om...[color=blue]
    > Hi:
    >
    > I have a form which contains the following entry ( one element on each[/color]
    line)[color=blue]
    >
    > Name
    > Address line 1
    > Address line 2
    > city, state, zip
    >
    > In many cases there is only ONE address line filled in (the other is for[/color]
    apartment numbers[color=blue]
    > and things). The way the form works now, the name is followed by address[/color]
    line one[color=blue]
    > (completed with data) and then a blank line followed by the city state and[/color]
    zip. It looks[color=blue]
    > scattered and untidy.
    >
    > Is there any way to vertically compress this so that when a line is blank[/color]
    it does not[color=blue]
    > appear or use a line on the form? This would make the form look a great[/color]
    deal tidier.[color=blue]
    >
    > Thanks
    >
    > John Baker
    >[/color]


    Comment

    • MGFoster

      #3
      Re: Form - compacting empty lines vertically.

      -----BEGIN PGP SIGNED MESSAGE-----
      Hash: SHA1

      I usually have only one Address field that is 255 characters long and
      the TextBox "Action on Enter" is "New Line." This will allow the user
      to enter a multi-line address in the same field.

      HTH,

      MGFoster:::mgf
      Oakland, CA (USA)
      -----BEGIN PGP SIGNATURE-----
      Version: PGP for Personal Privacy 5.0
      Charset: noconv

      iQA/AwUBP8ZCmIechKq OuFEgEQLNdgCg3x RmMx90JDmeHOvx7 iEuvgB0pr4AoN6w
      hH8JW6cl0kq5tQU l2pfQcgMO
      =PmLt
      -----END PGP SIGNATURE-----

      John Baker wrote:
      [color=blue]
      > Hi:
      >
      > I have a form which contains the following entry ( one element on each line)
      >
      > Name
      > Address line 1
      > Address line 2
      > city, state, zip
      >
      > In many cases there is only ONE address line filled in (the other is for apartment numbers
      > and things). The way the form works now, the name is followed by address line one
      > (completed with data) and then a blank line followed by the city state and zip. It looks
      > scattered and untidy.
      >
      > Is there any way to vertically compress this so that when a line is blank it does not
      > appear or use a line on the form? This would make the form look a great deal tidier.
      >
      > Thanks
      >
      > John Baker
      >[/color]


      Comment

      • John Baker

        #4
        Re: Form - compacting empty lines vertically.

        MGF:

        Thanks for the idea, but how do you set up the macro, or code, to create a new line?
        I set up:

        Private Sub address_Enter()
        New Line

        End Sub

        and it would not accept it!
        Regards

        John Baker

        MGFoster <me@privacy.com > wrote:
        [color=blue]
        >-----BEGIN PGP SIGNED MESSAGE-----
        >Hash: SHA1
        >
        >I usually have only one Address field that is 255 characters long and
        >the TextBox "Action on Enter" is "New Line." This will allow the user
        >to enter a multi-line address in the same field.
        >
        >HTH,
        >
        >MGFoster:::m gf
        >Oakland, CA (USA)
        >-----BEGIN PGP SIGNATURE-----
        >Version: PGP for Personal Privacy 5.0
        >Charset: noconv
        >
        >iQA/AwUBP8ZCmIechKq OuFEgEQLNdgCg3x RmMx90JDmeHOvx7 iEuvgB0pr4AoN6w
        >hH8JW6cl0kq5tQ Ul2pfQcgMO
        >=PmLt
        >-----END PGP SIGNATURE-----
        >
        >John Baker wrote:
        >[color=green]
        >> Hi:
        >>
        >> I have a form which contains the following entry ( one element on each line)
        >>
        >> Name
        >> Address line 1
        >> Address line 2
        >> city, state, zip
        >>
        >> In many cases there is only ONE address line filled in (the other is for apartment numbers
        >> and things). The way the form works now, the name is followed by address line one
        >> (completed with data) and then a blank line followed by the city state and zip. It looks
        >> scattered and untidy.
        >>
        >> Is there any way to vertically compress this so that when a line is blank it does not
        >> appear or use a line on the form? This would make the form look a great deal tidier.
        >>
        >> Thanks
        >>
        >> John Baker
        >>[/color]
        >[/color]

        Comment

        • John Baker

          #5
          Re: Form - compacting empty lines vertically.



          I should add that when I set up new line in the Expression Builder, it accepts it but when
          hit enter on the field, the form jumps to the next record! Not the behavior I want.

          To be honest I don't know how to stop it from doing that either.

          Regards

          John Baker


          John Baker <Baker.JH@Veriz on.net> wrote:
          [color=blue]
          >MGF:
          >
          >Thanks for the idea, but how do you set up the macro, or code, to create a new line?
          >I set up:
          >
          >Private Sub address_Enter()
          >New Line
          >
          >End Sub
          >
          >and it would not accept it!
          >Regards
          >
          >John Baker
          >
          >MGFoster <me@privacy.com > wrote:
          >[color=green]
          >>-----BEGIN PGP SIGNED MESSAGE-----
          >>Hash: SHA1
          >>
          >>I usually have only one Address field that is 255 characters long and
          >>the TextBox "Action on Enter" is "New Line." This will allow the user
          >>to enter a multi-line address in the same field.
          >>
          >>HTH,
          >>
          >>MGFoster:::mg f
          >>Oakland, CA (USA)
          >>-----BEGIN PGP SIGNATURE-----
          >>Version: PGP for Personal Privacy 5.0
          >>Charset: noconv
          >>
          >>iQA/AwUBP8ZCmIechKq OuFEgEQLNdgCg3x RmMx90JDmeHOvx7 iEuvgB0pr4AoN6w
          >>hH8JW6cl0kq5t QUl2pfQcgMO
          >>=PmLt
          >>-----END PGP SIGNATURE-----
          >>
          >>John Baker wrote:
          >>[color=darkred]
          >>> Hi:
          >>>
          >>> I have a form which contains the following entry ( one element on each line)
          >>>
          >>> Name
          >>> Address line 1
          >>> Address line 2
          >>> city, state, zip
          >>>
          >>> In many cases there is only ONE address line filled in (the other is for apartment numbers
          >>> and things). The way the form works now, the name is followed by address line one
          >>> (completed with data) and then a blank line followed by the city state and zip. It looks
          >>> scattered and untidy.
          >>>
          >>> Is there any way to vertically compress this so that when a line is blank it does not
          >>> appear or use a line on the form? This would make the form look a great deal tidier.
          >>>
          >>> Thanks
          >>>
          >>> John Baker
          >>>[/color]
          >>[/color][/color]

          Comment

          • John Baker

            #6
            Re: Form - compacting empty lines vertically.

            Hi Again:

            If the solution to this is more complex that it appears, I could always do a query on the
            fields and set upi one field with active address lines separated by a carriage return. I
            know that is chr(13) in Excel, but its doesn't appear to be in Access. Can someone tell me
            the chr code for a carrage return (enter)? With that I could construct something that
            would do what I need.

            Regards

            John Baker

            Comment

            • John Baker

              #7
              Re: Form - compacting empty lines vertically.

              How would I do that in a report?

              "MacDermott " <macdermott@nos pam.com> wrote:
              [color=blue]
              >This is easily accomplished in a report, but not so easily in a form.
              >Think of the form as the way to put the information in -
              > you always want those blank lines to be available, in case someone has
              >some more information to add.
              >Think of a report as how you get the information out:
              > that's where you do the tidy formatting.
              >
              >HTH
              > - Turtle
              >
              >"John Baker" <Baker.JH@Veriz on.net> wrote in message
              >news:ga3csvcja gbq2cs9al74j3er i502dg0aq2@4ax. com...[color=green]
              >> Hi:
              >>
              >> I have a form which contains the following entry ( one element on each[/color]
              >line)[color=green]
              >>
              >> Name
              >> Address line 1
              >> Address line 2
              >> city, state, zip
              >>
              >> In many cases there is only ONE address line filled in (the other is for[/color]
              >apartment numbers[color=green]
              >> and things). The way the form works now, the name is followed by address[/color]
              >line one[color=green]
              >> (completed with data) and then a blank line followed by the city state and[/color]
              >zip. It looks[color=green]
              >> scattered and untidy.
              >>
              >> Is there any way to vertically compress this so that when a line is blank[/color]
              >it does not[color=green]
              >> appear or use a line on the form? This would make the form look a great[/color]
              >deal tidier.[color=green]
              >>
              >> Thanks
              >>
              >> John Baker
              >>[/color]
              >[/color]

              Comment

              • John Baker

                #8
                Re: Form - compacting empty lines vertically.

                Hi:

                I am sorry to waste so much of every ones time on this. I found the way to deal with
                compaction in Reports, using the "Can Shrink" property. Simple, but only if you know if
                it!

                Regards

                John Baker

                Comment

                • Sunil Korah

                  #9
                  Re: Form - compacting empty lines vertically.

                  ---"It looks scattered and untidy.

                  Is there any way to vertically compress this so that when a line is
                  blank it does not appear or use a line on the form? This would make
                  the form look a great deal tidier."

                  As McDermott mentioned this is needed in the form

                  ---"How would I do that in a report?"
                  (This is from access help)
                  In the ControlSource property box, type an expression that
                  concatenates the values from the appropriate fields.
                  For example, to return an address like

                  507 20th Ave. E., Seattle WA 98122

                  type this expression:

                  =[Address] & ", " & [City] & " " & [Region] & " " & [PostalCode]

                  Tip In a form or report in a Microsoft Access database (.mdb), you
                  can also click the Build button to use the Expression Builder to
                  create the expression.

                  --" but how do you set up the macro, or code, to create a new line?"

                  This is on the prperties window of the text box. In the 'Other' tab
                  there is an item 'Enter Key Behaviour' where you should choose 'New
                  Line'

                  --"I know that is chr(13) in Excel, but its doesn't appear to be in
                  Access."

                  Carriage return is chr(13) everywhere. But carriage return takes the
                  cursor only to the beginning of the line. You need a new line before
                  it : chr(10)& Chr(13)

                  HTH

                  Sunil Korah

                  John Baker <Baker.JH@Veriz on.net> wrote in message news:<nstcsvsit 1vbq30f3hgjhmi4 5ac3aq7m0h@4ax. com>...[color=blue]
                  > Hi Again:
                  >
                  > If the solution to this is more complex that it appears, I could always do a query on the
                  > fields and set upi one field with active address lines separated by a carriage return. I
                  > know that is chr(13) in Excel, but its doesn't appear to be in Access. Can someone tell me
                  > the chr code for a carrage return (enter)? With that I could construct something that
                  > would do what I need.
                  >
                  > Regards
                  >
                  > John Baker[/color]

                  Comment

                  • MGFoster

                    #10
                    Re: Form - compacting empty lines vertically.

                    -----BEGIN PGP SIGNED MESSAGE-----
                    Hash: SHA1

                    What I meant was the Address Text Box property "Enter Key Behavior."

                    Open the form in design view.
                    Open the properties dialog box for the Address TextBox.
                    Click the Other tab.
                    Set the property "Enter Key Behavior" to "New Line in Field."

                    MGFoster:::mgf
                    Oakland, CA (USA)
                    -----BEGIN PGP SIGNATURE-----
                    Version: PGP for Personal Privacy 5.0
                    Charset: noconv

                    iQA/AwUBP8cPSYechKq OuFEgEQLo9ACfXs j3WY1HTM+8/YWhI/m2WkZfqLgAoNQ8
                    XGcmEvdctehH34W bPz8cs7gx
                    =Fp2+
                    -----END PGP SIGNATURE-----

                    John Baker wrote:[color=blue]
                    > MGF:
                    >
                    > Thanks for the idea, but how do you set up the macro, or code, to create a new line?
                    > I set up:
                    >
                    > Private Sub address_Enter()
                    > New Line
                    >
                    > End Sub
                    >
                    > and it would not accept it!
                    > Regards
                    >
                    > John Baker
                    >
                    > MGFoster <me@privacy.com > wrote:
                    >
                    >[color=green]
                    >>
                    >>I usually have only one Address field that is 255 characters long and
                    >>the TextBox "Action on Enter" is "New Line." This will allow the user
                    >>to enter a multi-line address in the same field.
                    >>[/color][/color]
                    < SNIP >

                    Comment

                    • John Baker

                      #11
                      Re: Form - compacting empty lines vertically. Thanks!

                      Thank you very much for your responses. I am sorry to be dense,but this is my first real
                      crack at an Access application, and some of the fine points require a bit of learning.

                      Again, thank you all very much

                      John Baker

                      Comment

                      • DFS

                        #12
                        Re: Form - compacting empty lines vertically.

                        You'll need to write a bit of code to move the text boxes around on the form
                        if there's no address line 2.

                        Something like:

                        if isnull(me.addre ssLine2) then
                        me.addressLine2 .visible = false
                        me.city.top = me.addressLine1 .top + me.addressLine1 .height + 25
                        me.state.top = me.addressLine1 .top + me.addressLine1 .height + 25
                        me.zip.top = me.addressLine1 .top + me.addressLine1 .height + 25
                        endif

                        I don't use them very often, but if your form is opened in continuous mode,
                        you may also need to reset the text box positions when Address Line 2 is
                        populated.

                        if not isnull(me.addre ssLine2) then
                        me.addressLine2 .visible = true
                        me.addressLine2 .top = me.addressLine1 .top + me.addressLine1 .height + 25
                        me.city.top = me.addressLine2 .top + me.addressLine2 .height + 25
                        me.state.top = me.addressLine2 .top + me.addressLine2 .height + 25
                        me.zip.top = me.addressLine2 .top + me.addressLine2 .height + 25
                        endif




                        "John Baker" <Baker.JH@Veriz on.net> wrote in message
                        news:ga3csvcjag bq2cs9al74j3eri 502dg0aq2@4ax.c om...[color=blue]
                        > Hi:
                        >
                        > I have a form which contains the following entry ( one element on each[/color]
                        line)[color=blue]
                        >
                        > Name
                        > Address line 1
                        > Address line 2
                        > city, state, zip
                        >
                        > In many cases there is only ONE address line filled in (the other is for[/color]
                        apartment numbers[color=blue]
                        > and things). The way the form works now, the name is followed by address[/color]
                        line one[color=blue]
                        > (completed with data) and then a blank line followed by the city state and[/color]
                        zip. It looks[color=blue]
                        > scattered and untidy.
                        >
                        > Is there any way to vertically compress this so that when a line is blank[/color]
                        it does not[color=blue]
                        > appear or use a line on the form? This would make the form look a great[/color]
                        deal tidier.[color=blue]
                        >
                        > Thanks
                        >
                        > John Baker
                        >[/color]


                        Comment

                        Working...