Results 1 to 8 of 8
  1. #1
    jc_msa is offline Novice
    Windows 11 Office 365
    Join Date
    Dec 2022
    Posts
    12

    Draw line between 2 sub reports

    I have a report with multiple subreports. One of these subreports shows a number of entries. Another subreport shows of the these entries broken down into its components. For example the first subreport shows Investments by Type. One of these investment types is Cash. The other subreport shows the banks in which the cash is held. In order to show that the Cash report is a breakdown of the Investment Type report, I want to draw a line from the Cash row in the Investment Report to the Cash Report. This is shown in the attachment.




    I would like to draw the green line from the Cash row to the Cash Report. Is it possible to determine the location of the Cash row in the first report so that I can draw the line to the Top of the other subreport?
    If this is not possible, is there another way to highlight that the Cash Report is a breakdown of the Investment Report - Cash entry?




  2. #2
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,101
    I'd use conditional formatting to color the Cash row in the first report (i.e. make it red or blue) and set the label (or the entire subreport) for the subreport 3 to use the same color....

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  3. #3
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,398
    you can determine it but complicated.

    1. have a row number as a hidden value in your recordsource - plenty of examples out there as to how to do that
    2. perhaps use dlookup to determine the row number for the cash row
    3. depends on how your sub report is made up but in principle to get the top you need get the top value for the subreport, plus height value for the subreport header plus ((rownumber-0.5)*height) of the subreport detail section
    4. to get the left, again depends - left of subform control+left of market value column+(market value column width*0.5) - or you can use left of subform control+width of subform control less some value to get it where you want

    gets even more complicated if subreport1 is scrollable

  4. #4
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Methinks you should have stuck with the other thread as it doesn't matter if it's marked solved. Or you should post a link to it in this thread?

    https://www.accessforums.net/showthread.php?t=87485
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #5
    jc_msa is offline Novice
    Windows 11 Office 365
    Join Date
    Dec 2022
    Posts
    12
    Thank you. This is my backup plan if I do not manage to get the arrows to work.

  6. #6
    jc_msa is offline Novice
    Windows 11 Office 365
    Join Date
    Dec 2022
    Posts
    12
    Your suggestion to get the row number works well. Now I am able to determine the start and end points of the line. I still have 2 more issues. Rather than just having a line, I would like to make this line look like an arrow by drawing 2 short lines at the end of the line to form an arrowhead. I have a question out to a math forum on how to determine the end points of the arrowhead.

    The other issue is that if a coordinate on my line has a value > 32767 then the line prints in the wrong direction. For example the command below should print a vertical line from Y = 30,000 to Y = 34,361. However the line goes from Y = 30,000 upwards rather than downwards.

    Me.Line (lineXPos, 30000)-(lineXPos, 34361)

    Any ideas why this would be?

  7. #7
    jc_msa is offline Novice
    Windows 11 Office 365
    Join Date
    Dec 2022
    Posts
    12
    Just adding that this is the solution I used to draw the arrowheads.

    https://stackoverflow.com/questions/...18623#75318623

  8. #8
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,398
    the other issue is that if a coordinate on my line has a value > 32767 then the line prints in the wrong direction.
    One of the properties of the line control is Line slant - which have the values of \ and / to indicate direction - set these as required

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 10
    Last Post: 10-14-2019, 10:08 AM
  2. How to draw a vertical line on a sub form
    By hassan.tajdar in forum Forms
    Replies: 4
    Last Post: 05-09-2017, 08:47 PM
  3. Line spacing issue in Access 2010 reports
    By rebfein in forum Reports
    Replies: 2
    Last Post: 07-05-2016, 12:07 PM
  4. Help with line count in reports.
    By OldCityCat in forum Reports
    Replies: 0
    Last Post: 04-11-2011, 08:21 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums