Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Reports / Printing / January 2006

Tip: Looking for answers? Try searching our database.

Vertical line between the columns of a two-column report

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Carl Imthurn - 05 Jan 2006 20:22 GMT
How do I put a vertical line down the middle of the detail section of a two-column report?
I know that I can put a line at the right end of the column 1, but it will repeat at the right end of column 2,
and I don't want that. Same principle applies to putting a line at the left end of column 1;
it will repeat at the left end of column 2.

Any and all help will be gratefully accepted.
Marshall Barton - 05 Jan 2006 22:14 GMT
>How do I put a vertical line down the middle of the detail section of a two-column report?
>I know that I can put a line at the right end of the column 1, but it will repeat at the right end of column 2,
>and I don't want that. Same principle applies to putting a line at the left end of column 1;
>it will repeat at the left end of column 2.

I think you will have to use the report's Line method in the
Page event.  The Help topic for this method is pretty
garbled so it may not be particularly enlightening.  The
general syntax if you know both end points:
    Me.Line (x1,y1)-(x2,y2)
Of you know one endpoint and the relative values to the
other end point:
    Me.Line (x,y)-Step(xlen,ylen)

Signature

Marsh
MVP [MS Access]

fredg - 05 Jan 2006 22:23 GMT
> How do I put a vertical line down the middle of the detail section of a two-column report?
> I know that I can put a line at the right end of the column 1, but it will repeat at the right end of column 2,
> and I don't want that. Same principle applies to putting a line at the left end of column 1;
> it will repeat at the left end of column 2.
>
> Any and all help will be gratefully accepted.

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 to start where you wish it to.

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.

Signature

Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

Carl Imthurn - 05 Jan 2006 22:37 GMT
Thank you both for your time and expertise. I will check this out.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.