Results 1 to 13 of 13
  1. #1
    notrino is offline Advanced Beginner
    Windows 10 Access 2010 64bit
    Join Date
    Feb 2016
    Location
    Izmir,Turkey
    Posts
    60

    Report with Picture

    Hi,

    I attached my application. You will see, picture size is 5x5cm. I want to report "print preview" like this;

    1) Picture position must be under the price
    2) If product hasn't got a picture (like second row) and has a small description, it should not create space. But my sample creating space everytime.


    3) If description textbox height is smaller than 0,8cm (like 0,6cm for example) picture is always shifting down.

    How can I solve this problems? Thank you.
    Attached Files Attached Files

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    instead of attachment field type, use an OLE field.
    paste the photo in the field via a form.

    the space must remain if you want a photo there. Even if there is no photo, but box must remain.

    text height should not change.

  3. #3
    notrino is offline Advanced Beginner
    Windows 10 Access 2010 64bit
    Join Date
    Feb 2016
    Location
    Izmir,Turkey
    Posts
    60
    Hello ranman256,

    You said, "the space must remain if you want a photo there". But when I change the picture area position (like near the price-not under the price) then everything is ok! System is working without any problem. But when I move the picture area to under the price, everything is breaking!

    Second, why do you prefer OLE object? I tried, but I didn't put the picture with OLE methode.

  4. #4
    notrino is offline Advanced Beginner
    Windows 10 Access 2010 64bit
    Join Date
    Feb 2016
    Location
    Izmir,Turkey
    Posts
    60
    So, I want to "auto-scale" feature for picture size and description text-box size. In this way, my problem can be solve. But how?

  5. #5
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,977
    Attachment datatypes are inefficient.
    They cause database sizes to increase dramatically and will reduce performance accordingly.

    OLE is better but there is another & even better method.
    Store the path to the image file(s) as a text field in your table
    Add an unbound image control (e.g. imgPhoto) to your form, then add code similar to this

    Me.imgPhoto.Picture = DLookup("ImagePath", "MyTableName", "ID = " & Me.ID)

    Scale your image by setting its Size Mode property to Zoom
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,928
    I agree with using Image control to display external image files better than embedding into table if there will be a lot of images. However, VBA is not needed. Expression can be in ControlSource property. Or in this case simply bind to field.

    The image must be positioned so its top is just above bottom of the description box to prevent pushing down.

    I tried code in report Detail Format event to conditionally set height of image but that fails. I recommend you have an alternate image of text that says "No image available ".
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    notrino is offline Advanced Beginner
    Windows 10 Access 2010 64bit
    Join Date
    Feb 2016
    Location
    Izmir,Turkey
    Posts
    60
    No, unfortunately, it is not working.

    Picture area has not got any auto-size feature with VBA codes.

  8. #8
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,977
    Saying 'it's not working' doesn't really tell us anything.

    Open your report in design view. Click on the image control then look in the property sheet.
    Find the size mode property and set it to zoom.

    If you can't find the property, you aren't using an image control
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  9. #9
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,928
    Colin, form and report using Image control with Zoom setting. Attempt to programmatically manage its Height in Detail Format event fails. The code runs but all instances of control set the same. Possibly because it does not have CanShrink and CanGrow properties.

    What exactly is not working? Did you read post 6?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  10. #10
    notrino is offline Advanced Beginner
    Windows 10 Access 2010 64bit
    Join Date
    Feb 2016
    Location
    Izmir,Turkey
    Posts
    60
    Hello,

    The problem solved with this methode;

    - In report SQL for check picture; attached the
    Code:
    Yuk: IIf(IsNull([resim]);0;-1)
    - On report details attached the invisible object for above expression
    - On report, details feature must be grow-shrink : Yes
    - Kimlik, Alan1, resim objects Tag(Im) must write YUKSEK
    - Details forming procedure must be;

    Code:
    PrivateSub Ayrıntı_Format(CancelAsInteger, FormatCount AsInteger)Dim Nesne As Control
    For Each Nesne In Me.Controls
         If Nesne.Tag = "YUKSEK" Then
               Me.Controls(Nesne.Name).Height = IIf(Me.Yuk = -1, 1500, 294)
         End If
         Me.Ayrıntı.Height = Me.resim.Height
    Next Nesne EndSub

  11. #11
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,928
    Glad you have a solution. I tried the expression in query to calculate Yuk field and get error. Did you remove Attachment field and make resim a Text field?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  12. #12
    notrino is offline Advanced Beginner
    Windows 10 Access 2010 64bit
    Join Date
    Feb 2016
    Location
    Izmir,Turkey
    Posts
    60

    Report with Picture

    Hi June7

    Please look at the attached file.
    Attached Files Attached Files

  13. #13
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,928
    Could just answer the question. Might download and look at later, eventually.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. How to creat a report as in the picture?
    By Nguyendunganh in forum Reports
    Replies: 0
    Last Post: 05-29-2018, 03:04 AM
  2. Replies: 8
    Last Post: 12-17-2017, 12:33 PM
  3. Replies: 1
    Last Post: 07-03-2017, 01:49 AM
  4. Adding a specific Picture to a report.
    By Atlascycle in forum Reports
    Replies: 1
    Last Post: 03-12-2012, 02:26 PM
  5. Inserting Picture in a report
    By dada in forum Reports
    Replies: 1
    Last Post: 09-17-2010, 01:38 PM

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