Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change height of Reports single text box and box controls

Status
Not open for further replies.

oxicottin

Programmer
Jun 20, 2008
353
US
Hello, I have been fiddling around with this all day and cant seem to get it to work correctly. I have a report that has various controls throughout the detail section and one text box in that section can grow. Well in this section with the text box that can grow there is a box around that section and this box is slightly larger in height so it boxes in all the text boxes/controls in that section. I need the box (bxSpecialInstructions) to grow in height when the text box (txtSpecialInstructions) grows BUT always stay slightly taller. I tried the VBA below and it works but the Box isn't constant in its height and always stays taller but gets to tall and doesn't keep the gap between the two consistent. How can I get it to work properly? Thanks!

I attached an example of my form. My Report is a one page report and is just data from a form using =Forms!bla.bla for its source.


Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

Me.bxSpecialInstructions.Height = Me.txtSpecialInstructions.Height + 8 * Len(Me.txtSpecialInstructions)

End Sub

Thanks,
SoggyCashew.....
 
Consider using the Line method of the report in the Print event of the detail section like:
Code:
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
    Me.bxSpecialInstructions.Visible = False
    Me.ForeColor = vbRed
    Me.DrawWidth = 6
    Me.Line (Me.bxSpecialInstructions.Left, Me.bxSpecialInstructions.Top)-Step _
    (Me.bxSpecialInstructions.Width, Me.txtSpecialInstructions.Height + 150), , B
End Sub


Duane
Hook'D on Access
MS Access MVP
 
Thank you Duane I will try this, I have seen/read you have sugested this quite a bit in the MS Comunity Forum and seemed to work for everyone, I just didn't know how to approach using it.

Thanks,
SoggyCashew.....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top