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

Vertical Lines - Reply to Jfischer / MichaelRed

Status
Not open for further replies.

Olifour

Technical User
Mar 6, 2002
12
0
0
FR
As I explained already in the past, I succeeded to get vertical lines in all a report, but there are some grouphead and I don't want them included in those vertical lines... So when you add size of sections (groupheader, pageheader) it gives a fixed height, but the datas in "A" can change the height... so my vertical line begins at the wrong place. Me.line ( ,A) - ( , B)

Other case, with the codes herewith below. I need the vertical line going from the section details (without grouphead) to the end of each page of the state. It should be simple because the reference at the end of the page do not move. I suppose we need to identify the end of the page and then to refer to it at place of "B".

Me.line ( ,A) - ( , B)

Please experiment a solution before giving it. It seems to be simple, but when you experiment, the solution is not ok. Thks for your kind help.

I precise than "Me.ScaleHeight" in place of "B" do not succeed.

Those codes are OK for section details, but vertical lines are not going till the end of the page.

Codes :

Option Compare Database
Option Explicit

Sub someControl_AfterUpdate()
Me!SomeControl = UCase(Me!SomeControl)
' ou encore
' me!SomeControl = Lcase(me!SomeControl)
End Sub

Private Sub Détail_Print(Cancel As Integer, PrintCount As Integer)
Dim CtlDetail As Control
Dim intLineMargin As Integer

' This is the spacing between the right edge of the
' control and the Vertical Seperation Line
intLineMargin = 10

' OK lets draw a vertical line to seperate each field
' for each control in details control
' If your last control on the right does not end on the edge of the section
' you will get a second vertical line. If you need to get around this then you
' can skip drawing this last Vertical Seperation Line in a couple of ways.
' We'll use the control name method Here. Our right most control is named
' TestMemo. IF current control is TestMemo - Do not print Vertical Line
For Each CtlDetail In Me.Section(acDetail).Controls
With CtlDetail
'If CtlDetail.name <> &quot;TestMemo&quot; Then
Me.Line ((.Left + .Width + intLineMargin), 0)-(.Left + .Width + _
intLineMargin, Me.Height)
'End If
End With
Next

'While we are here lets draw a box around the Detail section
With Me
Me.Line (0, 0)-Step(.Width, .Height), 0, B
End With

Set CtlDetail = Nothing

End Sub

Private Sub Report_Activate()
DoCmd.Maximize
End Sub
 
The soloution I posted (&quot;basVertLIne&quot;) will work if you identify and insert the proper identification of the end point (YOUR &quot;B&quot;) as the &quot;Y2&quot; position identifier. I am not clear -from your posts- how that point is identified. &quot;State&quot; and / or &quot;B&quot; and / are not clearly identified. It MIGHT be the PageFooter.Top, or one of the group footers .bottom or some other placement.

I never intended to furnish a complete custom soloution, but a general procedure which can be used to achieve your goals, with your input to the various parameters, and any CUSTOM versioning of the code.

In my first post, I assumed all you needed was the syntax for the position of the Horizontal line which would be used as the top anchor. The process of drawing on a report with the correct placement of lines depends on the format / print events, as the height of controls (and therefore sections) may vary with the grow / shrink properties of individual control elements.
MichaelRed
m.red@att.net

There is never time to do it right but there is always time to do it over
 
I agree with Michael. I don't understand your post. I had read your post to mean that you needed a vertical line drawn from a horizontal Line173 in a group header to the top of the PageFooter section. Please clarify your post.

Do you want vertical lines to extend through any blank space beyond the last detail section on a page to the bottom of the page (or even just to the top of the PageFooter)? If so, you need to draw those lines in the OnPage event of the report, not the Detail Print event.
 
Thks for your comments. I appreciate. I study all this and will revert to you probably tomorrow.
Rgds.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top