Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Line Method for use with expanding controls

Status
Not open for further replies.

nikademous

Technical User
Sep 9, 2018
41
US
Hello, I have a sub report that I want to use and understand how the line method works to draw lines around controls and the detail section.

In my sub report I have a text box named (txtComponentInstalInstruction) and next to it I have a image box (imgJobStep). The image is always going to be 400X400 Pixels so I need the (imgJobStep) to match up with it BUT dont allow the (imgJobStep) to expand past the 400 Pixels in height. I Have the the column layout going across then down so I can get a textbox/image "Space" textbox/image then down to next line so it fits 6 of those on a report.

The only way I got it working was to mess with the textbox width and the image width and keep going back and forth to print preview. Can someone please explain how this works? I also needed to limit the height of the textbox to no more than 400 Pixes and have no clue how...

Attached is an image of how I have it and how I want it to look just have no idea how it works...then theirs the 400px thing.

Code:
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)

' Stephen Lebans 1999
' Stephen@ lebans.com
' [URL unfurl="true"]www.lebans.com[/URL]

Dim CtlDetail As Control
Dim intLineMargin As Integer

' This is the spacing between the right edge of the control and the Vertical Seperation Line
intLineMargin = 60

For Each CtlDetail In Me.Section(acDetail).Controls
   If CtlDetail.Visible = True Then 'Added
    With CtlDetail
        Me.Line ((.Left + .Width + intLineMargin), 0)-(.Left + .Width + _
intLineMargin, Me.Height)
    End With 'Added
    End If
Next

        'While we are here lets draw a box around the Detail section
    With Me
        Me.Line (0, 0)-Step(.Width, .Height), 0, B
    End With

Set CtlDetail = Nothing

End Sub

Thanks,
 
So you subreport is set to 1 column according to the image. Why not two columns? Also set the height of the text box to 400 pixels and don't allow it to shrink or grow.

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016
 
Duane, what do you mean by this? [highlight #FCE94F]"So you subreport is set to 1 column according to the image. Why not two columns?"[/highlight] Second I never thought of setting the height and dont allow to grow [tongue]. What would the measurement be in inch for the 400px?

I attached what my subreport looks like in design. On a side note can you explain the line method, I really want to know how it works... OR do you know or have an example DB of different ways it works?

Thanks,

----
 
 https://files.engineering.com/getfile.aspx?folder=ca863f0d-14f8-4422-b91f-03628b310738&file=subreport.JPG
I assume:
[ul]
[li]txtComponentInstalInstruction and the imgJobStep are on the subreport[/li]
[li]the subreport is linked to the main report based maybe on component and part[/li]
[li]the subreport is two column - across then down[/li]
[li]the height of the subreport detail section is about 3"[/li]
[/ul]

You should be able to set the height of txtComponentInstalInstruction and imgJobStep to about 3"
You can add two adjacent rectangles about 3" x 3". One is around txtComponentInstalInstruction and the other around imgJobStep.

I don't think you need the line method because the detail section of the subreport doesn't need to grow. You want 400 pixels.

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top