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
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