Results 1 to 8 of 8
  1. #1
    Join Date
    Nov 2012
    Posts
    32

    Unanswered: Change images in Access by VBA

    Hi all!

    I would like to ask you for help on the issue I'm having.

    I would like to be able to dynamically change some pictures on my forms. These pictures are design elements, not bound to any data (logos, form header images etc.). I would like to have these images stored within my database, not call them by links (like C:\...\img.png(/jpg/bmp)). The images are very small, each around 3 KB in size and there would be probably around 30 images.

    I have read something about the issue (like storing the images like OLE Objects in tables) but I still couldn't mange to make much sense of it.

    I would like to be able to do something like this in VBA:
    MyForm.ImagePlaceholder.Source = DLOOKUP(Img,tblImages, "img_ID = 1")

    If someone could help me or point me in a right direction, I would be very grateful!

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    personally storing images inside the db does nothing for me, they tend to bloat the db, I prefer to store a URL to the image inside the DB. however if you only have 30 or so images and they are all less than 3KB they I don't think the bloating issue matters.

    the help file should provide you with enough guidance on how to store images inside the db and then access them.
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Nov 2012
    Posts
    32
    Hi Healdem,

    Thank you for your reply. I didn't get many answers from that, however. I tried the help file before but since I'm not sure what exactly to look for my search wasn't really efficient.

    What do you mean store the image inside the DB and call it by URL?

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    no
    the options are
    either store the images inside the DB
    OR
    store the URL to the image inside the DB
    there's pros and cons to both approaches. in your proposed usage I'd (probably) favour storing the image inside the DB rather than images outside the DB.


    As ever there is no hard a fast rule.
    I'd rather be riding on the Tiger 800 or the Norton

  5. #5
    Join Date
    Nov 2012
    Posts
    32
    And how would I accomplish storing the image inside the DB and display it using VBA? I am still unable to find a solution for this, in every tutorial I saw people are using URL strings to call images from outside of the DB because they are worried about DB bloat, but since my images are so small and there is so little of them, bloat shouldn't be much of an issue.

    I've got multiple users using their own front end of the DB and I'd rather not force them to store their copy somewhere with another folder with a few images.

  6. #6
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    frankly as I don't store pictures inside an Access (or any other db for that matter....) I don't know

    if the obvious search terms don't work then try OLE picture
    BLOB
    Image Control
    I'd rather be riding on the Tiger 800 or the Norton

  7. #7
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    using Access 2010 and the search times
    "store picture in Access" seemed to provide lots of hits....
    I'd rather be riding on the Tiger 800 or the Norton

  8. #8
    Join Date
    Nov 2012
    Posts
    32
    Okay, I'll try. Thanks for your help.

Posting Permissions

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