Results 1 to 6 of 6
  1. #1
    5 Star Lounger
    Join Date
    May 2001
    Location
    Patterson Lakes, Melbourne, Victoria, Australia
    Posts
    637
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Change textbox height in report (2002 SP3)

    Is there any way of increasing the height of a textbox to match the height of another textbox that can grow in a report? I tried this code in the OnFormat event of the detail section of the Report:
    If [txtBackground].Height <> [txtStreet].Height Then
    [txtBackground].Height = [txtStreet].Height
    End If
    But this does nothing.
    [txtBackground].CanGrow is set to True. Both controls are visible.
    Regards,
    Peter

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Change textbox height in report (2002 SP3)

    Height is the property as set in design view, not the actual height of the text box.
    An obvious "solution" is not to use borders around the text boxes. If you do want borders, you will still have to use transparent borders for the text boxes, and draw the borders in code. See <post:=145,479>post 145,479</post:>.

  3. #3
    5 Star Lounger
    Join Date
    May 2001
    Location
    Patterson Lakes, Melbourne, Victoria, Australia
    Posts
    637
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Change textbox height in report (2002 SP3)

    Thanks Hans. Although I was certain that [txtBackground].Height refers to the height of that textbox.
    What I was trying to do was to highlight certain records. Every record of, say, type
    Regards,
    Peter

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Change textbox height in report (2002 SP3)

    If you want to highlight the entire record, you can also set the background color of the Detail section:

    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    If SomeCondition Then
    Me.Details.BackColor = RGB(224, 224, 224)
    Else
    Me.Details.BackColor = vbWhite
    End If
    End Sub

  5. #5
    5 Star Lounger
    Join Date
    May 2001
    Location
    Patterson Lakes, Melbourne, Victoria, Australia
    Posts
    637
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Change textbox height in report (2002 SP3)

    Thanks again (yet again) Hans. Much more elegant.
    BTW do you know of any way to do the same thing for a form detail section?
    Regards,
    Peter

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Change textbox height in report (2002 SP3)

    In a continuous form, you'd use a background text box with conditional formatting like your solution for reports.Other methods are illustrated in <post:=288,539>post 288,539</post:> and <post:=382,292>post 382,292</post:>.

Posting Permissions

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