Link to home
Start Free TrialLog in
Avatar of bfuchs
bfuchsFlag for United States of America

asked on

How can I eliminate spacing between two instances of a sub report.

Hi Experts,

I have a report with a sub report, for some reason the sub report have extra spaces that I'm looking to get rid of them.
See attached pic of sub report..
Untitled.png
Avatar of PatHartman
PatHartman
Flag of United States of America image

Open the sub in design view and make sure that the bottom of the form is tight against the bottom of the lowest control.
Avatar of Linens Range786
Linens Range786

Unfasten the secondary in propose question paper and make clear in your mind that the foundation of the form is stretched against the foundation of the lowly be in command of.
Also be sure you're not showing the Form Footer/Header in the subform.
Avatar of bfuchs

ASKER

Ok Experts,

I removed all spaces also removed header/footer section and still getting spaces shown.

See design of my sub attached.

and here is the code in detail format event.
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    Dim i As Integer
    For i = 1 To 10
        If Len(Me.Controls("Patient_Progress_Notes_" & i)) > 0 Or Len(Me.Controls("Time_" & i)) > 0 Then
            Me.Controls("line" & i).Visible = True
        Else
            Me.Controls("line" & i).Visible = False
        End If
    Next
End Sub

Open in new window


Thanks,
Ben
Untitled.png
Avatar of bfuchs

ASKER

And here is the design of my main report.

Thanks,
Ben
Untitled.png
Avatar of bfuchs

ASKER

And this is how it looks like in preview..

Thanks,
Ben
Untitled.png
your data is not normalized which is contributing to your problem.  Based on the pictures, it looks like only a couple of the numbered items actually have values.  This wouldn't be a problem at all in a continuous subreport.  to solve the problem here, you will need to adjust the properties so that all the controls are set to can grow and can shrink = yes.  You will probably also need to get rid of the separator line since unless you want to write code, there is no way to suppress that.
Avatar of bfuchs

ASKER

Hi Pat,

you will need to adjust the properties so that all the controls are set to can grow and can shrink = yes.  
This is how they're currently set.
You will probably also need to get rid of the separator line since unless you want to write code, there is no way to suppress that.
This is how I was advised to do, https://www.experts-exchange.com/questions/29072443/How-to-have-a-line-between-controls-that-can-grow-shrink.html perhaps you have another way to accomplish that?
besides, the spaces dont seem to come from within the sub itself, just rather from 2 instances of the report, as the first columns of sub report contain surrounding lines, and see where are the spaces located, (last attachment).


Thanks,
Ben
Make sure that the controls do not overlap.  Controls that overlap will not shrink/grow.  You may have to paste the report with some data so we can play with it if the overlap isn't the problem.
Avatar of bfuchs

ASKER

@Pat,

No controls overlapping.

See attached app, look at report Patient_Progress_Notes2Rep

Thanks,
Ben
db58.zip
The problem is all the space between the controls.  While the controls are eliminated, none of the other space is.  So, that's where the excess space is coming from.  I removed it all:User generated image
Avatar of bfuchs

ASKER

And how does it looks like now in preview?
See attached how it looks by me, not presentable..


Thanks,
Ben
Untitled.png
There will be some happy medium.  You will have to find it by trial and error.  The fewer the number of items in a set, the more wasted space at the end.  Try using borders on the controls rather than lines between them. That will eliminate some of the wasted white space.

It is probably a lot of trouble at this point to normalize the table but that solves the problem without code.  Normalization is always the best method.  Do it now or do it later.
Avatar of bfuchs

ASKER

Hi Pat,

Try using borders on the controls rather than lines between them
This option is also not something that looks elegant, unless I can hide the side borders.

Really I would like to see a solution that would deal with the problem with code, similar to what Jim had suggested in the other post, meaning check if there is no data in control then beside of hiding it, it will also move them up and move up the following items as well..

Let me know if this is doable.

Thanks,
Ben
Have you considered normalizing the table?
Avatar of bfuchs

ASKER

Hi,

Of Course, in fact I originally designed the table/report in a normalized state, and now users switched to Caspio web builder, and at the moment they're are in charge of the Caspio site of the program, I have to deal with importing data into Access and implementing whatever its missing in Caspio..
Resulting in poor database design++..

Thanks,
Ben
ASKER CERTIFIED SOLUTION
Avatar of PatHartman
PatHartman
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bfuchs

ASKER

thank you!
You're welcome.