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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Underlining the entire line of a textbox in an access 2000 report 1

Status
Not open for further replies.

Smokinn

Programmer
Jan 30, 2004
4
CA
Basically my detail section is just a box with the description. It can get
pretty long. I made the textbox unshrinkable but it can get longer. That way
it always takes the middle half of my page. My problem is that I want every
line in that box underlined, whether there is text or not. Is there a way to
do this? I looked around and didn't find any option in the properties or
help that seemed helpful so I figured I'd brute force it and stick in a
bunch of lines. These lines don't show up on a second page though so it was
futile.

Any ideas?

If you don't understand my explanation I can put some screenshots on the web
to give a better visual.
 
You might try setting the "Special Effect" property of the textbox to "Chisled"

Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
Assuming your text box is named txtComments and it is in the detail section, you could use the code below. You may need to change the intLineSpacing depending on your font size.
Code:
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
    Dim intLineSpacing As Integer
    Dim intMaxHeight As Integer
    Dim intLoop As Integer
    intMaxHeight = Me.txtComments.Height
    intLineSpacing = 190
    For intLoop = Me.txtComments.Top + intLineSpacing To _
            Me.txtComments.Top + intMaxHeight _
            Step intLineSpacing
        Me.Line (Me.txtComments.Left, intLoop)- _
            Step(Me.txtComments.Width, 0)
    Next
End Sub

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
Thank you so much this was exactly what I needed.
 
Turns out with this your report can't be more than 1 page long. If you have a page footer or header the details section will write over it on the next page. I used Stephen Leban's AutoTextSize module ( to make my textbox the right size then used your code to put in the individual lines.
I'm going to give up on trying to make the forms exactly as their paper ones and just make a new model of them I think.

Thank you anyway.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top