Results 1 to 11 of 11
  1. #1
    J Bhujanga is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2016
    Location
    Colorado
    Posts
    27

    Getting stored images to appear in a Form

    I have a form in which I display a multitude of information relative to automobile accidents.


    One of the items I wish to show is an arrow that describes the vehicles direction and movement. There are 32 possible arrows configurations (8 directions x 4 movement types (straight, right turn, left turn, U-turn)). I have these 32 arrows made in small '.gif' files and have assigned a 4-digit code to each one ( e.g. EBLT for EastBound Left Turn, NBUT, for NorthBound U-Turn, etc.)
    I made a table in which I store the gifs as OLE_Objects with the 4-digit code in a text field for finding the right one.
    The 4-digit lookup code is essentially calculated from 'Direction' and 'Movement' fields, which is easily done. I want to look up the appropriate gif image based on this code and display it on the form.
    So, what I thought might work is to put a Bound Object Frame control control on my form and set the control source with a Dlookup formula that finds the image.
    Well it finds the image, but only displays it name (EBLT.gif) with a generic icon. I find there is a "Display Type" property associated with the Bound Object Frame control which has two choices - "Content" or "Icon", and I have it set to "Content" but still get the icon.
    Where am I going wrong?

  2. #2
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    Would it be easier to save them in an attachment field. I don't know for certain but I read somewhere that OLE object don't show as pics until you click on them.


    Sent from my iPhone using Tapatalk

  3. #3
    J Bhujanga is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2016
    Location
    Colorado
    Posts
    27
    I started out that way, but couldn't make it work either. I've never used Attachment fields before and I'm not clear on how to reference things in them.
    What I'm talking about is the way the Attachment data type apparently creates an invisible system table in which it let's you store many attachment in what appears to be a single field and record in the table where the field is created.
    This being the case, simply referring to that field the normal way wouldn't seem to give it enough information to look up the particular object. Even though I will always only have one object associated with each record, the fact that it allows for more would suggest there is an extended method of accessing them, which I'm not clear on how to do. I don't know if that's the only thing I'm missing to get it to work using that type field, but anything that I've tried just results in nothing happening.

  4. #4
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    If you have 1 attachment then it should be to tricky. I've created a form based on a table with two rows and an attachment in each one. The form wizard picked up the attachments perfectly.

    I've had success referencing them via recordset and might be able to help


    Sent from my iPhone using Tapatalk

  5. #5
    J Bhujanga is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2016
    Location
    Colorado
    Posts
    27
    I can't get it to work. I need more detail. How are you going about referencing it? For example, are you putting it in the control source property of the attachment control? And if so what is your syntax? Bear in mind that my form isn't based on the table where the images exist. I'm needing to look them up based on data that is in the table on which the form is based, hence trying to use the DLookup formula in my control source, but getting nothing.
    Thanks.

  6. #6
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051

    Getting stored images to appear in a Form

    Have you given the attachment field a caption in the table

    I think it's automatically set as a paper clip but you can set it to picture (e.g.) to reference it


    Sent from my iPhone using Tapatalk

  7. #7
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    Might be easier to open a recordset to get it. I've certainly done that.


    Sent from my iPhone using Tapatalk

  8. #8
    J Bhujanga is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2016
    Location
    Colorado
    Posts
    27
    Yes, the field is named Diagram. The text field is called Diagram_Code. These 32 records are stored in thetable "Movement_Diagrams"
    If I make a form based on that table it works fine. But I need to reference those images from a form based on a different table.
    So, I replace the control source which is just "Diagram" when I make form based on the "Movement_Diagrams" table, with the following DLookup statement:
    =Dlookup("[Diagram]","Movement_Diagrams","[Movement_Code]='" & [MCode] & "'")
    where MCode is a field in the table on which the calling form is based. I have verified that the data it contains truly matches the data in the Movement_Code field, but I get nothing.
    Specifically, does anyone know why this is not working?

  9. #9
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    If you can zip a small version of the problem here I'll gladly look into it.


    Sent from my iPhone using Tapatalk

  10. #10
    J Bhujanga is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2016
    Location
    Colorado
    Posts
    27
    It's just over 2 gigs right now, so I'll need to create a stripped down version. I'll see how small I can get it and send tomorrow hopefully.

  11. #11
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2013 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Instead of using external gif files, create label controls on the form, hunt through your fonts until you find an arrow (Windings?). Then make those fields visible/invisible based on the data.

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

Similar Threads

  1. Replies: 9
    Last Post: 02-16-2015, 05:54 PM
  2. Replies: 8
    Last Post: 11-10-2012, 03:03 AM
  3. Retrieve images stored as file paths in Access
    By Nonz in forum Programming
    Replies: 4
    Last Post: 09-26-2011, 06:46 PM
  4. Replies: 1
    Last Post: 04-13-2010, 12:18 PM
  5. Replies: 17
    Last Post: 08-26-2009, 11:27 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