Results 1 to 7 of 7
  1. #1
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919

    Change picture property of image control


    I don't see where to set the picture property on an image control as the Detail section is formatted. On a continuous form, the detail section includes a thumbnail image. The name of the image that is to be used as the picture property is included in each record. I can set a default image in the picture property in design mode, but I don't see where to override the image name as the form opens. There's no OnFormat for the Detail section and trying to use the OnPaint just seems to put Access in some sort of strange loop if I try to set the Picture property there.

    I could change the ControlSource for the control, but again, without a format event I don't see where?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,921
    There certainly is Format event for Detail section.

    However, use ControlSource property and Format event code is not needed. Using Picture property and VBA was necessary back with Access 2003 before ControlSource property was added to Image control.

    Are these external image files, not embedded in table? Simply set ControlSource to an expression that includes the image file path. If this is a split db with backend on server, advise use the server name, not a drive letter mapping.

    Example:

    ="\\servername\folderpath\" & [fieldname] & ".jpg"
    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.

  3. #3
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    There certainly is Format event for Detail section.
    Exactly what I expected but the event does not show up in the list of events for that section. So, I set the ControlSource of the image control in design mode to

    Code:
    "c:\PictureBoxes\PicImages\" & [PicName]
    Where PicName is an expression of the form "name.jpg" or "name.png" and is included in the control source query for the form.

    Access says the expression I used is invalid.................... edit Oops! forgot the "=" ALL GOOD NOW

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,921
    Not showing = sign.

    Your PictureBoxes folder is located at C: root, not in a Users folder?

    Sorry, I was thinking of report for Detail Format event. Correct, forms do not have Format event (don't see Paint either). On form would probably use Current event to dynamically set Picture property. However, no form event would work nice for Continuous form.
    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.

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Quote Originally Posted by June7 View Post
    There certainly is Format event for Detail section.
    On a form? Not in my experience.

    Off to the air races!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,921
    Quote Originally Posted by pbaldy View Post
    On a form? Not in my experience.
    See post 4.
    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
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    Your PictureBoxes folder is located at C: root, not in a Users folder?
    Just something temporary for my own use.

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

Similar Threads

  1. change image control when cursor hovers
    By GraeagleBill in forum Forms
    Replies: 9
    Last Post: 05-25-2019, 11:23 AM
  2. Link image control with part name of picture
    By wasim_sono in forum Forms
    Replies: 1
    Last Post: 03-03-2017, 03:54 AM
  3. Replies: 7
    Last Post: 11-08-2013, 08:28 PM
  4. Replies: 9
    Last Post: 05-07-2012, 06:11 PM
  5. syntax on setting image Picture control
    By cowboy in forum Reports
    Replies: 2
    Last Post: 02-18-2010, 10:00 AM

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