• Status: Solved
  • Priority: High
  • Security: Public
  • Views: 50
  • Last Modified:

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..)
Untitled.png
0
bfuchs
Asked:
bfuchs
  • 2
1 Solution
 
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.
0
 
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
Else
    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.

Jim.
0
 
bfuchsAuthor Commented:
@Jim,
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
        Else
            Me.Controls("line" & i).Visible = False
        End If
    Next
End Sub

Open in new window


Thanks,
Ben
0
 
bfuchsAuthor Commented:
Thank you!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now