How to have a line between controls that can grow/shrink?

Hi Experts,

I have a report that looks like attached.

Would like to have a line displayed between the controls horizontally, and since controls can grow, I would like to have the line pushed down accordingly, however when no data which it will cause control to shrink, would like line to be invisible..

How can I accomplish that?

(db not in a normalized state, but that's not for now..)
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Máté FarkasDatabase Developer and AdministratorCommented:
Please draw (with Paint or something else) a picture about the desired view of that report. Provide an example when controls are shrinked / grown. Thanks.
Jim Dettman (Microsoft MVP/ EE MVE)President / OwnerCommented:
<<however when no data which it will cause control to shrink, would like line to be invisible..>>

 You'll need to do this in the OnFormat event:

If NZ(Me.Time_1 ,"") = "" then
    Me.MyLine_1.Visible = False
    Me.MyLine_1.Visible = True
End If

 and repeating that for each of the line.     Note that 'MyLine_1' should be the name of the line control.   What's there is just an example.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
bfuchsAuthor Commented:
OK I applied like that
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
            Me.Controls("line" & i).Visible = False
        End If
End Sub

Open in new window

bfuchsAuthor Commented:
Thank you!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.