×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Line Method for use with expanding controls

Line Method for use with expanding controls

Line Method for use with expanding controls

(OP)
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 --> VBA

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

' Stephen Lebans 1999
' Stephen@ lebans.com
' www.lebans.com

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,

RE: Line Method for use with expanding controls

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

RE: Line Method for use with expanding controls

(OP)
Duane, what do you mean by this? "So you subreport is set to 1 column according to the image. Why not two columns?" 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,

----

RE: Line Method for use with expanding controls

I assume:
  • txtComponentInstalInstruction and the imgJobStep are on the subreport
  • the subreport is linked to the main report based maybe on component and part
  • the subreport is two column - across then down
  • the height of the subreport detail section is about 3"
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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close