Access 2007 attachments in a form

I will need my form to display some attachments that I attached to specific items in a table. How would I go about doing this, I would like them displayed as links, and the attachments are doc, xls and pdfs. There will be multiple attachments, I have no idea how to do this.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Helen FeddemaCommented:
If the attachments are stored in the new Attachment type field, they are displayed as icons, and you can open the attachment from the Manage Attachments dialog (see below).  For an actual link, you could use a Hyperlink field, with a link to a file on your computer, but that would only work on your computer.
Helen FeddemaCommented:
You can store multiple attachments in an Attachment field.  Here is a link to download a sample database and article about Access 2007 Attachment fields:
joshldAuthor Commented:
I need to know how I use the "control source" of a attachment box to select a specific field in a table.
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

Your question is a front end designer's field day.   Here's one way:

Display the attachments in subform linked to the main form.  Make the subform continuous so the attachments are represented in a list.  Note, you could do something very similar with a listbox control instead of a continuous subform.  The advantage of the subform is that it gives you a lot more control over the appearance of the links:  namely, you can present them as thumbnails or make them look and act like hyperlinks.

When the attachment is selected, code behind could then shell out to the appropriate application for presenting the attachment.

A word about attachments.  Access 2007 has a new data type for attachments and a corresponding form control for viewing the attachments.  That's a very nice feature, but do understand the size limitations.  No attachment may exceed 256MB and the total of all attachments may not exceed 2000MB.    So before you go the route of attachment fields, make sure you won't soon run into those limits.

One other thought, perhaps worth an experiment, is to leverage the attachment feature in conjunction with the more traditional method of storing the attachments in the file system and keeping their URL's (or filepath's) in the database. What I mean is to create a "work" table with an attachment field. When a specific record is selected on the main form, then load the work table with just the attachments for that record.  




Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Access 2007 includes an Attachment Control you can drop on the form, which will display your Attachments as clickable objects:

If you need to work with Attachments via code, here's the standard for opening Attachment via VBA:
>Access 2007 includes an Attachment Control you can drop on the form, which will display your Attachments as clickable objects:

Very nice, but subject to the limitations of row and database size.  2GB adds up pretty fast when you're talkin about multiple PDF, XLS, DOC attachments per row.  Just take care to do some sizing projections before you invest your solution in those technologies.
joshldAuthor Commented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.