UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Limit Growth Of Vertical Line In Reports, Access 2003    
 
   
Hein
post Jul 10 2019, 12:13 PM
Post#1



Posts: 477
Joined: 10-November 05
From: The Netherlands


Hi all

In 1 of my reports I have a vertical line that "grows" with the length of the section, together with the number of records in that detail.

I found some code here that I've used and that works very well.
The code I've found is:

CODE
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)

Dim CtlDetail As Control
Dim intLineMargin As Integer

intLineMargin = 0

For Each CtlDetail In Me.Section(acDetail).Controls
    With CtlDetail
        If CtlDetail.Name = "line83" Then
        Me.Line ((.Left + .Width + intLineMargin), 0)-(.Left + .Width + intLineMargin, Me.Height)
        End If
    End With
Next

Set CtlDetail = Nothing

End Sub


To the right of this line I have, for each record/row, a little horizontal line to make it easier to see where a new record begins
The vertical line "grows" all the way to the bottom of the detail section.

This means that below the last horizontal line there is a bit of vertical line left, which is especially apparent when there is only 1 record.

Is it possible to have the growing vertical line, but make it a little less longer (e.g. 0.2 cm)?

I have tried (among other changes) to change the me.height (me.height - 0.2) but that doesn't work.

Can it be done?

Thanks in advance
Hein
Go to the top of the page
 
theDBguy
post Jul 10 2019, 12:27 PM
Post#2


Access Wiki and Forums Moderator
Posts: 75,699
Joined: 19-June 07
From: SunnySandyEggo


Hi. Have you tried subtracting some value from Me.Height? You may have to experiment what value would be good enough for your taste.

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 
Hein
post Jul 10 2019, 12:35 PM
Post#3



Posts: 477
Joined: 10-November 05
From: The Netherlands


Hi DBGuy

That was my first attempt.
When that failed I tried to change to the code with dim DetailHeight as ... control / object / ... : detailheight = me.height - 0.2

I also tried to add some brackets (me,height -0.2)

I also tried to work with the first part of the me.line (changing the intLineMargin although I knew this wouldn't work)
Same with the 2nd part of that line

Nothing works, and I can't find anything on line, despite a long search

Hopefully you know what to do

Hein
Go to the top of the page
 
theDBguy
post Jul 10 2019, 12:37 PM
Post#4


Access Wiki and Forums Moderator
Posts: 75,699
Joined: 19-June 07
From: SunnySandyEggo


Hi. Can you post a sample db?

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 
Hein
post Jul 10 2019, 12:40 PM
Post#5



Posts: 477
Joined: 10-November 05
From: The Netherlands


I will, give me some time to prepare this, it is on another computer
Go to the top of the page
 
Hein
post Jul 10 2019, 12:48 PM
Post#6



Posts: 477
Joined: 10-November 05
From: The Netherlands


Can you work with this?
Attached File(s)
Attached File  Sample_offspring.zip ( 17.83K )Number of downloads: 2
 
Go to the top of the page
 
theDBguy
post Jul 10 2019, 01:20 PM
Post#7


Access Wiki and Forums Moderator
Posts: 75,699
Joined: 19-June 07
From: SunnySandyEggo


Hi. See if you can start with this...

Attached File(s)
Attached File  Sample_offspring.zip ( 23.9K )Number of downloads: 4
 

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 
Hein
post Jul 10 2019, 01:38 PM
Post#8



Posts: 477
Joined: 10-November 05
From: The Netherlands


Brilliant!!

Thank you very much, as always! thanks.gif

Am I right in my assumption that you check each record in the detail section if it is the last record.
If not then make the line as long as the record is.
If it is the last record, then make the line longer but not as long as usual (200 "units" less)

Based on what I see in the properties windows I would never have gone as high as 200, but I think I would have stayed below 1

Anyway, another question solved !

Thanks DBGuy !!
Hein
Go to the top of the page
 
theDBguy
post Jul 10 2019, 01:41 PM
Post#9


Access Wiki and Forums Moderator
Posts: 75,699
Joined: 19-June 07
From: SunnySandyEggo


Hi Hein. You're correct! You can experiment with the number. It doesn't have to be 200. Good luck!

PS. Actually, I just thought of something... I just checked it... You can comment out that line after the If/Then, we don't need it. Basically, if it's the last record, don't adjust the line. Cheers!

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    16th July 2019 - 05:14 AM