Access Attachment Gallery

This is yet another proof of concept that I developed while trying to help someone in a forum. The simple idea here was to be able to display multiple attachments in one view rather than needing to go through them, one by one.

In the example below, we have a main ‘Product’ form with a ‘Product Images’ subform which will display the various image associated to the currently shown product.

What I’m Working On

The above proof of concept is very simple and satisfied the person’s need, but I wanted to take thing further and make it a complete attachment management tools.  So I’ve been working, and am currently testing, the next version which will include

  • Having no limit on the number of attachment that are displayed
  • Ability to navigate – scroll through the attachments
  • Ability to save the attachments to a location of your choosing
  • Ability to Add new attachments to the current record
  • Ability to Delete the selected record
  • Selected attachment gets highlighted
  • etc…

Here’s what it will look like

Disclaimer/Notes:

If you do not have Microsoft Access, simply download and install the freely available runtime version (this permits running MS Access databases, but not modifying their design):

Microsoft Access 2010 Runtime
Microsoft Access 2013 Runtime
Microsoft Access 2016 Runtime
Microsoft 365 Access Runtime

All code samples, download samples, links, ... on this site are provided 'AS IS'.

In no event will Devhut.net or CARDA Consultants Inc. be liable to the client/end-user or any third party for any damages, including any lost profits, lost savings or other incidental, consequential or special damages arising out of the operation of or inability to operate the software which CARDA Consultants Inc. has provided, even if CARDA Consultants Inc. has been advised of the possibility of such damages.

 

Download a Demo Database

Feel free to download a 100% unlocked demo copy by using the link provided below:

Download “Access - Attachment Gallery (accdb x32)” MultipleImageSubFrm.zip – Downloaded 7116 times – 1.47 MB

Version History

V1.000 (2018-02-02)

Initial release

V1.001 (2018-02-07)

Fixed a bug triggered by non-En versions of Access (Thank you azer for reporting the issue)

11 responses on “Access Attachment Gallery

  1. azer

    Hi , interesting developement !
    Im trying it on access 2010 , i do have that error :
    Error number : 220
    error source : form_products_images\form_open
    error descripion : attachement gallery demo – by cara can not orpen the file “(none)”

    i htink i m missing a file , shall i put a none.jpg in the same folder as the atabase or inside the /temp created in the database folder ?

    1. Daniel Pineault Post author

      No, you’re not missing any files.

      I can’t seem to replicate the issue though. I tried in Access 2007, 2010 & 2013 and never experience any issue.

      The database is in a trusted location so the VBA code can run?
      The database is in a folder that allows it to create a “temp” subfolder and freely write/delete files within it?
      You could try compiling to see if it flags any issues at your end.

  2. azer

    The database is in a trusted location so the VBA code can run?
    yes , where i have other database running : d:/tmp

    The database is in a folder that allows it to create a “temp” subfolder and freely write/delete files within it?
    yes and i even created manually one and put the attributes to be sure it s fully writable

    You could try compiling to see if it flags any issues at your end.
    no flag.

    the error at the opening is within that vba loop
    ‘Position Ctrl properly
    For i = 1 To lNoImgCtl
    Me(“Img” & i).Left = iInitLeftPos – (iDistBtwCtls * (i – 1))
    Me(“Img” & i).DefaultPicture = “(none)”
    Me(“Img” & i).OnDblClick = “=ViewAttachment(“”” & “Img” & i & “””)”
    Next i

    and the yellow color is on : Me(“Img” & i).DefaultPicture = “(none)”

    1. Daniel Pineault Post author

      My hunch right now is a language issue. Are you running Office En (standard us install)?

      I will do some more test.

      You could try switching
      Me(“Img” & i).DefaultPicture = “(none)”
      To
      Me(“Img” & i).DefaultPicture = “”
      and see if by any chance that works

  3. azer

    perfect now it is working .
    I was thinking if the form should handle unlimited images , maybe the most efficient way would be to have a drag and drop box where all the file path would be taken , then copied or moved to the subdirectory that would use your routine already given in : “Adding Attachments to an Access Database”

    1. Daniel Pineault Post author

      As you can see by my post, under the heading “What I’m Working On”, version 2.000 will enable this and much more. Version 1.00 was just a proof of concept to help someone out in a forum, while version 2.000 will be a fully enabled gallery. I also want to make a vertical scroll on top of the current horizontal scroll. Of course, time permitting (I’m currently working on something else).

  4. MeFontLa

    In demo file, the main form NOT look like the second image in your web. No button add/import picture, No save button, No delete button.
    Please kindly check again your file demo. Thanks

        1. Daniel Pineault Post author

          I’m afraid I’m no longer certain I will release another version.

          Office, and Access in particular, have become so unstable in the past 5 years that I have moved away from Office/Access development as my primary focus. Relying on Access for business critical application has become too much of a gamble with its continual bugs causing downtime and thousands of $$$ in lost production, IT services, … that I no longer recommend Access to clients, but do continue to support it as required.

          All that to say that I have no immediate intentions of continuing development at this point in time.