Results 1 to 2 of 2
  1. #1
    Join Date
    May 2003
    Location
    Dallas
    Posts
    817
    Provided Answers: 5

    Unanswered: Changing Image picture property causes image to not appear

    Basically in code I look for a an image path and file name in a table and I pass those parameters to so that the

    rpt.Controls(sCtrlName) = Reports!PeriodicDataMain01!image985
    After setting these properties (at runtime in the on open event of the report)
    the image never is visible - just blank.

    As I step through the code - all values are set and in fact a message box prior to the report displaying reflects all the changes i passed to it.


    If intheight >= intwidth Then
    rpt.Controls(sCtrlName).Height = 864
    rpt.Controls(sCtrlName).Width = 864
    rpt.Controls(sCtrlName).Visible = True
    rpt.Controls(sCtrlName).PictureType = 1
    rpt.Controls(sCtrlName).Picture = sPFN
    rpt.Controls(sCtrlName).SizeMode = acOLESizeZoom


    debug.print rpt.Controls(sCtrlName).Height
    1
    ?rpt.Controls(sCtrlName).Width
    2
    ?rpt.Controls(sCtrlName).Visible
    True
    ?rpt.Controls(sCtrlName).PictureType
    1
    ?rpt.Controls(sCtrlName).Picture
    C:\Working\Images\clientlogo.bmp
    ?rpt.Controls(sCtrlName).SizeMode
    3

    But the image nevershows on the report

    I am using an image control and the funny thing is - is that I have the properties preset to Picture = C:\Working\Images\clientlogo.bmp
    and linked - but it never shows when I run the code!!

    I am dying here i was given this as A QUICK patch and i am on 8 hours of this??
    Dale Houston, TX

  2. #2
    Join Date
    May 2010
    Posts
    601
    Quote Originally Posted by axsprog View Post
    Basically in code I look for a an image path and file name in a table and I pass those parameters to so that the

    rpt.Controls(sCtrlName) = Reports!PeriodicDataMain01!image985
    After setting these properties (at runtime in the on open event of the report)
    the image never is visible - just blank.

    As I step through the code - all values are set and in fact a message box prior to the report displaying reflects all the changes i passed to it.


    If intheight >= intwidth Then
    rpt.Controls(sCtrlName).Height = 864
    rpt.Controls(sCtrlName).Width = 864
    rpt.Controls(sCtrlName).Visible = True
    rpt.Controls(sCtrlName).PictureType = 1
    rpt.Controls(sCtrlName).Picture = sPFN
    rpt.Controls(sCtrlName).SizeMode = acOLESizeZoom


    debug.print rpt.Controls(sCtrlName).Height
    1
    ?rpt.Controls(sCtrlName).Width
    2
    ?rpt.Controls(sCtrlName).Visible
    True
    ?rpt.Controls(sCtrlName).PictureType
    1
    ?rpt.Controls(sCtrlName).Picture
    C:\Working\Images\clientlogo.bmp
    ?rpt.Controls(sCtrlName).SizeMode
    3

    But the image nevershows on the report

    I am using an image control and the funny thing is - is that I have the properties preset to Picture = C:\Working\Images\clientlogo.bmp
    and linked - but it never shows when I run the code!!

    I am dying here i was given this as A QUICK patch and i am on 8 hours of this??
    The on open event of the report is probably the issue. Try moving the code to he On Format event for the section with the the control.
    Boyd Trimmell aka HiTechCoach HiTechCoach.com (free access stuff)
    Microsoft MVP - Access Expert
    BPM/Accounting Systems/Inventory Control/CRM
    Programming: Nine different ways to do it right, a thousand ways to do it wrong.
    Binary--it's as easy as 1-10-11

Posting Permissions

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