Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    New Lounger
    Join Date
    Mar 2004
    Location
    Naples, Florida
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Shrink line with embedded photo (2000 SP3)

    I have two membership list databases which when linked can out put a report with the member's photo if available.

    I'd like the line of those members without a photo to take a single line, not to be the height of the non-existent photo.

    Can I do this?

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Shrink line with embedded photo (2000 SP3)

    Set the property Can shrink from the picture control and from the Detail section to Yes.
    Francois

  3. #3
    New Lounger
    Join Date
    Mar 2004
    Location
    Naples, Florida
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Shrink line with embedded photo (2000 SP3)

    The picture from the second database is an OLE object. This object doesn't allow the can shrink property.

  4. #4
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Shrink line with embedded photo (2000 SP3)

    I haven't try it but maybe you can use the On Format event of the Detail section of the report to check if there is a picture and according to this, set the Height property of the control to 0 or to the desired number.
    Francois

  5. #5
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Shrink line with embedded photo (2000 SP3)

    Just test it.
    Following code is working, picPicture is the name of my Bound Object frame. The height are set in pixels.<pre>Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    If IsNull(Me.picPicture) = True Then
    Me.picPicture.Height = 0
    Me.Detail.Height = 500
    Else
    Me.picPicture.Height = 1980
    Me.Detail.Height = 2267
    End If
    End Sub</pre>

    Francois

  6. #6
    New Lounger
    Join Date
    Mar 2004
    Location
    Naples, Florida
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Shrink line with embedded photo (2000 SP3)

    Thanks - I've just got home and it's night here.

    I'll try this tommorrow.

  7. #7
    New Lounger
    Join Date
    Mar 2004
    Location
    Naples, Florida
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Shrink line with embedded photo (2000 SP3)

    I am no programmer and when I go into the properties of my embeded photo the is nothing under the event category so I don't know where to try your code.

  8. #8
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Shrink line with embedded photo (2000 SP3)

    Open your report in design view.
    Select the detail section by clicking on the Detail division bar.
    Open the property window and select the Event tab.
    Click on the On Format line, then click on the button with the 3 dots on the right.
    In Choose Builder, select Code Builder.
    Now you are in the VBE window with the cursor between the lines:
    Private Sub Detail1_Format(Cancel As Integer, FormatCount As Integer)

    End Sub
    Between these two lines past the code :
    <font color=blue>If IsNull(Me.picPicture) = True Then
    Me.picPicture.Height = 0
    Me.Detail.Height = 500
    Else
    Me.picPicture.Height = 1980
    Me.Detail.Height = 2267
    End If</font color=blue>
    Replace picPicture with the name of your activex control.
    Close the vbe window and run your report. You'll have to adjust the numbers 500, 1980 and 2267 according your report.
    Francois

  9. #9
    New Lounger
    Join Date
    Mar 2004
    Location
    Naples, Florida
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Shrink line with embedded photo (2000 SP3)

    THANK YOU - that got it. My problem was that I was looking into the properties of the photo not the section.

    Thanks once again.

  10. #10
    New Lounger
    Join Date
    Mar 2004
    Location
    Naples, Florida
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Shrink line with embedded photo (2000 SP3)

    OOPS -I thought I had it, but no.

    I've attached 2 files, zipped, 1 is a screen print of the access page where I worked on it, the second is a pdf file of the first page of the report.

    I also don't understand why there isn't a blue line under each record.

    I'd really appreciate your help again.

    Thanks

  11. #11
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Shrink line with embedded photo (2000 SP3)

    When you set the Detail.Heigt to 50 it seems to me that this is to small. The measure are twips. One Twip is 1/1440 of an inch.
    The reason the space is not cropped is that you line and other controls are there.
    You'll have to move them upwards. To do that, use :
    Me.Line1.Top = 100
    Me.Text1.top = 10

    To see what the actual settings are, put a breakpoint on the line :
    If IsNull(Me.picPicture) = True Then
    To set a breakpoint, put the cursor on the line and press F9. The line turns brown.
    Run the report, and when the code pause, press CTRL-G to open the Immediate window.
    In this window, type :
    ? Me.Detail.Heigt
    and press enter. The answer is the height of the detail section in twips.
    You can do that for to other settings. Based on that, you'll have to try or calculate what the best result is.
    To execute the rest of the code, press F5 (remove the breakpoint again with F9 as the Detail Format code will run for each record).
    Francois

  12. #12
    New Lounger
    Join Date
    Mar 2004
    Location
    Naples, Florida
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Shrink line with embedded photo (2000 SP3)

    OK - I got the Me.Line1.Top part, but the information line is made up of several text boxes with different names.

    I tried moving one of the boxes up if there is no picture, but it moves up in all cases.

    When there is no picture I inserted - Me.Detail.Height = 100, but going any lower doesn't reduce the size of the detail section.

    I've attached files as before.

    Please tell me if I'm taking too much of your time.

    I really appreciate the help and I'm learning something new to me which is always fun.

  13. #13
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Shrink line with embedded photo (2000 SP3)

    You have to set the top of all the controls on both side of the else statement :
    <pre>If IsNull(Me.photo) = True Then
    Me.line1.Top = 100
    Me.Spouse.Top =50
    Me.Photo.Height = 100
    Me.Detail.Height = 100
    Me.OtherControl.Top = 50
    ...
    Else
    Me.line1.Top = 1000
    Me.Spouse.Top =250
    Me.Photo.Height = 1100
    Me.Detail.Height = 1200
    Me.OtherControl.Top = 250
    ...
    End If</pre>

    And add a line for each control in the detail section. As long as there will be controls a little lower, the detail section will not be smaller then the lowest control. (Hope I made my thinkings clear. If not feel free to ask)

    PS the top of the line should be lower then the top of the spouse control. A greater value. As it has to appear under the spouse control. The numbers I give you in the samples are completely random as I don't have your db to test.
    Francois

  14. #14
    New Lounger
    Join Date
    Mar 2004
    Location
    Naples, Florida
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Shrink line with embedded photo (2000 SP3)

    Thanks for being understanding.

    I've attached the code the way I have it now. The problem is that I get an error - "the control or subform is too large for this location".

    If I understand in both sections the "IF" and "ELSE" the TOP command means the location of the top of the control relative to the top of the record being shown, and the HEIGHT command means the total height of that control.

    If that's true I can't figure out why the Top would be too large. I tried changing the Me.Line1.Top in the Else section to 1150 but it was still "too large".

  15. #15
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Shrink line with embedded photo (2000 SP3)

    I think it would be better if you set the height of the detail before the top of the line.
    ...
    Else
    Me.Detail.Height = 1200
    Me.Line1.Top = 1150
    ...

    If the detail height is still 100 from the previous record, you'll not be able to set the top of line1 to 1150.
    Can you try this ?
    Francois

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •