Results 1 to 6 of 6
  1. #1
    albe_ACC is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2011
    Posts
    8

    Insert Image associated to specific value

    Hi guys!
    I'm building a report: I have a field (let's call it "Result") that I want to associate to a specific image.
    For example, when field "Result" equals 1, I want the report to display a specific image/icon (for example a ); when field "Result" equals 0, I want the report to display another image ( ).
    DO you know if there's a way to do it?
    Thank you very much for your help!!

    AL!

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Is it only the 2 images? One way is to have image control for each image set to not visible and then VBA code in the Format event of section of report where images are located would make one of the image controls visible. This will not work in Detail section if multiple records are reported.

    Another method is to use the ControlSource property of image control to dynamically display image. The property could be set to a field of table that has the image stored or the path to the image in folder.
    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
    hertfordkc is offline 18 year novice
    Windows XP Access 2007
    Join Date
    Mar 2011
    Posts
    481

    One way to put an image in a report

    My test is too big to attach, probably because of the size of the images I chose.
    Here's what I did:
    1) Created a table with one column, Result.
    2) Created a table with two columns, ID and Image.
    3) Created a query with a calculated column based on the value of the result field, e.g. if Result <= 1, then ImageID = 3, else ImageID = 4.
    4) Created another query based on step 3 which has a result column, an imageID column and an image column.
    5) Created a report based on that query.
    Try it. If it doesn't work, I'll try to put in smaller images and post the DB.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Run Compact & Repair, zip, is it still too big - up to 2mb zip allowed.
    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
    albe_ACC is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2011
    Posts
    8
    Thank you very much guys!
    I'll try hertfordkc trick today!

  6. #6
    hertfordkc is offline 18 year novice
    Windows XP Access 2007
    Join Date
    Mar 2011
    Posts
    481

    Test image insertion

    testz.zip is what I tried to describe above.
    Thanks, June7

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

Similar Threads

  1. INSERT query: insert new data only
    By drh in forum Access
    Replies: 2
    Last Post: 04-04-2014, 05:31 PM
  2. Insert Image in Access 2010 ???
    By cowboy in forum Access
    Replies: 5
    Last Post: 03-18-2014, 08:22 AM
  3. how to insert image in database
    By sbglobal in forum Programming
    Replies: 1
    Last Post: 08-26-2010, 08:43 AM
  4. Insert an image in a form
    By bladu in forum Forms
    Replies: 1
    Last Post: 09-10-2009, 11:13 AM
  5. Insert an image in database
    By microbert in forum Database Design
    Replies: 1
    Last Post: 06-22-2009, 01:57 PM

Tags for this Thread

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