sizing vertical lines to detail section height

C

chris halley

Hello,
I create report with textboxes with property 'cangrow' set to 'true'. Also I
have vertical lines on the report's detail section to seperate data fields
(textboxes).
When textboxes grows vertical lines remain with its oryginal height and they
don't make continuous lines throu all the detail section while report is
printed.
How and when to change size of the lines to have it throu all heigh of
detail section?
thanks in advance
k.halski
 
F

fredg

Hello,
I create report with textboxes with property 'cangrow' set to 'true'. Also I
have vertical lines on the report's detail section to seperate data fields
(textboxes).
When textboxes grows vertical lines remain with its oryginal height and they
don't make continuous lines throu all the detail section while report is
printed.
How and when to change size of the lines to have it throu all heigh of
detail section?
thanks in advance
k.halski

Use the Line method in the Report's Page event.

Place this code in the Report's Page event to draw a line down the
center of the page, from the bottom of the Page Header to the top of
the Page Footer.

You'll need to change X1 if you want the line drawn elsewhere on the
page.
' *** ALL NUMBERS ARE IN PIXELS... ***

Private Sub Report_Page()
Dim X1, Y1, X2, Y2 As Single
Me.DrawStyle = 0 ' a solid line

Me.DrawWidth = 1 ' set the thickness of the line

' Set the coordinates and draw a line down the middle of the page.

X1 = Int(Me.ScaleWidth / 2) ' find the middle of the page
Y1 = Me.Section(3).Height ' start just below the page header
X2 = X1 ' the line is vertical

' length of line is the length of the Page - (Height of the Page
' Header + Height of the Page Footer).

Y2 = Me.ScaleHeight - (Me.Section(1).Height + Me.Section(4).Height)

Me.Line (X1, Y1)-(X2, Y2) ' This draws the line

End Sub
=======

This line
Y1 = Me.Section(3).Height ' start just below the page header
has to be adjusted if you wish it to start elsewhere.

If you also have a group header, simply add it's height to the Page
Header height.

Y1 = Me.(Section(3).Height + Me.Section(X).Height

Change the (X) above to whatever the number value of the Group Section
is.
The Report Header section is (1), the Page Header section is (3).
The Group Header section number will vary, according to the layout of
your report. You may have to include any other section's height as
well.
 
C

chris halley

thank for your help, but...

I simply copied your code to my vba editor and as a result my line starts at
top of detail section but ends before end of it , sometime closer sometime
farther to the end of section.
Can't I simply resize my desing time vertical lines to fit height of one row
(with variable size due to 'cangrow' property of textboxes) of detail
section?
k.h.
ps. I'm using ms access 2003 sp2 if it does matter.
 
S

Stephen Lebans

Scroll down towards the bottom of this page to the older non class based
version of Print Lines.
http://www.lebans.com/PrintLines.htm
PrintLines is the older version that demonstates several methods not found
in the PrintLinesClass project.

PrintLinesA97 - Create Vertical lines, Borders and boxes with VBA code.

New Ver 19 January 20, 2002. Added support for vertically centering the
contents of a TextBox or Label control.

a.. How to create a margin for your TextBox.
b.. How to Draw Vertical lines the entire vertical length of your Report.
c.. How to Draw a Grid.
d.. How to force the contents of a Memo field to fit within a fixed sized
control.
e.. Lots of other stuff!
--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


chris halley said:
thank for your help, but...

I simply copied your code to my vba editor and as a result my line starts
at top of detail section but ends before end of it , sometime closer
sometime farther to the end of section.
Can't I simply resize my desing time vertical lines to fit height of one
row (with variable size due to 'cangrow' property of textboxes) of detail
section?
k.h.
ps. I'm using ms access 2003 sp2 if it does matter.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top