Shrink fields by conditional formatting

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

    Shrink fields by conditional formatting

    Hello
    Environment: Windows XP, MS Access 2003.

    I'd like - in a report - to save space , when there is no company
    data.
    When there is, I print out company name, address, telephone number and
    mobile - 4 lines. When there is no company data, these 4 lines are
    made invisible by the following code:

    Private Sub GroupHeader0_Fo rmat(Cancel As Integer, FormatCount As
    Integer)
    If Not IsNull(Controls ("txtCOMPANY"). Value) Then
    Controls("txtCO MPANY").Visible = -1
    Controls("txtCO MPANYADDRESS"). Visible = -1
    Controls("lblCO MPANYADDRESS"). Visible = -1
    Controls("lblCO MPANYADDRESS"). Value = "Company address:"
    Controls("txtCO MPANYTELEPHONEN UMBER").Visible = -1
    Controls("lblCO MPANYTELEPHONEN UMBER").Value = "Company Telephone
    N:"
    Controls("lblCO MPANYTELEPHONEN UMBER").Visible = -1
    Controls("lblCo mpanyMobile").V isible = -1
    Controls("txtCO MPANYMOBILENUMB ER").Visible = -1
    Controls("lblCo mpanyMobile").V alue = "Company Mobile:"
    Else
    Controls("txtCO MPANY").Visible = 0
    Controls("txtCO MPANYADDRESS"). Visible = 0
    Controls("lblCO MPANYADDRESS"). Visible = 0
    Controls("lblCO MPANYADDRESS"). Value = Null
    Controls("txtCO MPANYTELEPHONEN UMBER").Visible = 0
    Controls("lblCO MPANYTELEPHONEN UMBER").Visible = 0
    Controls("lblCO MPANYTELEPHONEN UMBER").Value = Null
    Controls("txtCO MPANYMOBILENUMB ER").Visible = 0
    Controls("lblCo mpanyMobile").V isible = 0
    Controls("lblCo mpanyMobile").V alue = Null
    End If
    End Sub

    The bound text fields shrink, when there is no data and "Can Shrink"
    is set to Yes.

    In an attempt to shrink labels I have made unbound text fields instead
    of labels and set "Can Shrink" to Yes. I also assign Null to these
    text fields, - as you see in the code. (The names have prefix lbl, but
    they are text fields.) Despite of all these, they do not shrink and
    there are empty places, which occupy quite a bit of space.

    If you know how to make unbound text fields to shrink, please could
    you let me know?

    Thank you.

    Galkas
  • Keith Wilby

    #2
    Re: Shrink fields by conditional formatting

    "Galka" <galkas@mail.ru wrote in message
    news:fbba1bd0-f3da-4e6c-80f4-68a209425dac@34 g2000hsf.google groups.com...
    >
    In an attempt to shrink labels I have made unbound text fields instead
    of labels and set "Can Shrink" to Yes. I also assign Null to these
    text fields, - as you see in the code. (The names have prefix lbl, but
    they are text fields.) Despite of all these, they do not shrink and
    there are empty places, which occupy quite a bit of space.
    >
    If you know how to make unbound text fields to shrink, please could
    you let me know?
    >
    Is the Group Header's "Can shrink" property also set to "Yes"?

    Keith.


    Comment

    • Galka

      #3
      Re: Shrink fields by conditional formatting

      On May 15, 2:45 pm, "Keith Wilby" <h...@there.com wrote:
      "Galka" <gal...@mail.ru wrote in message
      >
      news:fbba1bd0-f3da-4e6c-80f4-68a209425dac@34 g2000hsf.google groups.com...
      >
      >
      >
      In an attempt to shrink labels I have made unbound text fields instead
      of labels and set "Can Shrink" to Yes. I also assign Null to these
      text fields, - as you see in the code. (The names have prefix lbl, but
      they are text fields.) Despite of all these, they do not shrink and
      there are empty places, which occupy quite a bit of space.
      >
      If you know how to make unbound text fields to shrink, please could
      you let me know?
      >
      Is the Group Header's "Can shrink" property also set to "Yes"?
      >
      Keith.www.keithwilby.com
      Keith
      How ingeniously simple! No, it was not. Now it is and shrinks all
      right. Thank you.
      Galina

      Comment

      • Keith Wilby

        #4
        Re: Shrink fields by conditional formatting

        "Galka" <galkas@mail.ru wrote in message
        news:b46765c4-3989-4878-8c65-56c3d79e792f@k1 3g2000hse.googl egroups.com...

        You're welcome, glad I could help.

        Keith.


        Comment

        Working...