Vertical Lines only in Detail Section

A

Amir Surani

Hello all,
I am using Access 2003 on Windows XP
I visited www.lebans.com and downloaded the PrintlinesClass2K. But it is too
complicated for me to adapt
I have very limited knowledge.

I have copied the following formula from the Newsgroup. I need help to
modify it to draw vertical
lines only in the Detail Section.

The following is in Report _Page(). I have modified it as necessary .. But
the output is shown as vertical
from top to bottom of the page. I need vertical lines only in the Detail
section. If I put this code under Detail_Print it prints allright but the
vertical lines does not go down upto the Footer Section, which is what I
require. Also the Right edge does not have a vertical line. Hope I am
clear. I need vertical lines at the left edge as well as the right edgeon
my Report; and also next to each control on my Report.

Can this macro be modified to print vertical lines only in the
Details_Section with vertical lines going right through down upto the Footer
Section

Any help would be appreciated.
TIA
Rashid Khan

Option Compare Database
Option Explicit
Dim intDetailEnds As Integer
Private Sub Report_Page()
Const TWIPSPERINCH = 1440

' Offset from right edge of Control where our
' Vertical Line will start - adjust as you desire.
' Expressed in Twips
Dim intLineMargin As Integer

' Need Control object to loop through Control Collection
Dim CtlDetail As Control

' Y position where we will start Drawing our Grid from
Dim startY As Integer

'Assumes Margins expressed in INCHES
'Change for your Locale
Dim varBMargin As Variant
'varBMargin = Application.GetOption("Bottom Margin")
'varBMargin = Val(varBMargin)
'varBMargin = varBMargin * TWIPSPERINCH

' Assumes Margins expressed in INCHES
' Change for your Locale
'Dim varTMargin As Variant
'varTMargin = Application.GetOption("Top Margin")
'varTMargin = Val(varTMargin)
'varTMargin = varTMargin * TWIPSPERINCH


' intLineMargin is expressed in TWIPS
intLineMargin = 60

' How thick our Line will be
Me.DrawWidth = 4


' We need to draw a vertical line at the left
' edge of our report. All other vertical lines are to the
' right edge of the existing controls
' You should place the right most control at the extreme
' right edge of your report - intMargin
With Me
Me.Line ((0), .Section(acDetail).Height) _
-(0, .ScaleHeight - _
(.Section(acDetail).Height))
End With

' OK lets draw a vertical line to seperate each field
' for each control in details control
For Each CtlDetail In Me.Section(acDetail).Controls

' Don't draw a Vertical line at end of Horizontal Line control - not
needed
If Not TypeOf CtlDetail Is Access.Line Then
With CtlDetail
Me.Line ((.Left + .Width + intLineMargin),
Me.Section(acDetail).Height) _
-(.Left + .Width + intLineMargin, Me.ScaleHeight - _
(Me.Section(acDetail).Height))

Debug.Print "YPos:" & .Left + .Width + intLineMargin
End With
End If
Next

' If there is still room between where Detail Section ends
' and the Top of the Page Footer Section.
'If intDetailEnds < (Me.ScaleHeight + varBMargin) -
(Me.Section(acDetail).Height) Then


'CleanUp time
Set CtlDetail = Nothing

End Sub
' ***CODE END
 
R

Rick B

Not sure I am following your question, but I have a report where I simply
used the drawing tools to place vertical lines between several fields of my
report detail. I also placed a horizontal line in the group header and
footer so it looks like all the details are in a box. No coding, nothing
fancy.

Again, I may be wayy off base from what you are trying to do.

Rick B


Hello all,
I am using Access 2003 on Windows XP
I visited www.lebans.com and downloaded the PrintlinesClass2K. But it is too
complicated for me to adapt
I have very limited knowledge.

I have copied the following formula from the Newsgroup. I need help to
modify it to draw vertical
lines only in the Detail Section.

The following is in Report _Page(). I have modified it as necessary .. But
the output is shown as vertical
from top to bottom of the page. I need vertical lines only in the Detail
section. If I put this code under Detail_Print it prints allright but the
vertical lines does not go down upto the Footer Section, which is what I
require. Also the Right edge does not have a vertical line. Hope I am
clear. I need vertical lines at the left edge as well as the right edgeon
my Report; and also next to each control on my Report.

Can this macro be modified to print vertical lines only in the
Details_Section with vertical lines going right through down upto the Footer
Section

Any help would be appreciated.
TIA
Rashid Khan

Option Compare Database
Option Explicit
Dim intDetailEnds As Integer
Private Sub Report_Page()
Const TWIPSPERINCH = 1440

' Offset from right edge of Control where our
' Vertical Line will start - adjust as you desire.
' Expressed in Twips
Dim intLineMargin As Integer

' Need Control object to loop through Control Collection
Dim CtlDetail As Control

' Y position where we will start Drawing our Grid from
Dim startY As Integer

'Assumes Margins expressed in INCHES
'Change for your Locale
Dim varBMargin As Variant
'varBMargin = Application.GetOption("Bottom Margin")
'varBMargin = Val(varBMargin)
'varBMargin = varBMargin * TWIPSPERINCH

' Assumes Margins expressed in INCHES
' Change for your Locale
'Dim varTMargin As Variant
'varTMargin = Application.GetOption("Top Margin")
'varTMargin = Val(varTMargin)
'varTMargin = varTMargin * TWIPSPERINCH


' intLineMargin is expressed in TWIPS
intLineMargin = 60

' How thick our Line will be
Me.DrawWidth = 4


' We need to draw a vertical line at the left
' edge of our report. All other vertical lines are to the
' right edge of the existing controls
' You should place the right most control at the extreme
' right edge of your report - intMargin
With Me
Me.Line ((0), .Section(acDetail).Height) _
-(0, .ScaleHeight - _
(.Section(acDetail).Height))
End With

' OK lets draw a vertical line to seperate each field
' for each control in details control
For Each CtlDetail In Me.Section(acDetail).Controls

' Don't draw a Vertical line at end of Horizontal Line control - not
needed
If Not TypeOf CtlDetail Is Access.Line Then
With CtlDetail
Me.Line ((.Left + .Width + intLineMargin),
Me.Section(acDetail).Height) _
-(.Left + .Width + intLineMargin, Me.ScaleHeight - _
(Me.Section(acDetail).Height))

Debug.Print "YPos:" & .Left + .Width + intLineMargin
End With
End If
Next

' If there is still room between where Detail Section ends
' and the Top of the Page Footer Section.
'If intDetailEnds < (Me.ScaleHeight + varBMargin) -
(Me.Section(acDetail).Height) Then


'CleanUp time
Set CtlDetail = Nothing

End Sub
' ***CODE END
 
R

Rashid Khan

Hi Rick,
Sorry thats not what I want. I have Detail Section followed by OrderID
Footer and after that Page Footer. What I am after is a vertical line which
should start from the Detail Section run over OrderID Footer and end just
above the Page Footer.
 
R

Rick B

Just draw a vertical line in the OderID footer as well.

Rick


Hi Rick,
Sorry thats not what I want. I have Detail Section followed by OrderID
Footer and after that Page Footer. What I am after is a vertical line which
should start from the Detail Section run over OrderID Footer and end just
above the Page Footer.
 
E

emile M

what if you don't now how long the line must be 1 or 2 pages. I think thats the reason you dont want to use afixed line. i now the problem but not the awnsers.
 
R

Rick B

You make the line as tall as the detail section and as tall as the footer or
header.

If your detail section is 1/4 inch and you have 40 records, then the line
will become 10 inches long. If the footer is 1/2 inch you draw a line form
top to bottom of your footer in the same exact position as the line in your
detail section. The line will appear solid and continuous when you run the
report. The only time you might run into an issue is if you set your detail
to "can grow". Not sure how to handle that one.

I do this on one of my reports and it works fine. Looking at the report
you'd think you were looking at something created in Excel with gridlines
showing.

Rick B




what if you don't now how long the line must be 1 or 2 pages. I think
thats the reason you dont want to use afixed line. i now the problem but not
the awnsers.
 

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