?
Solved

Access 2007 attachments in a form

Posted on 2010-03-31
7
Medium Priority
?
1,599 Views
Last Modified: 2013-11-28
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.
0
Comment
Question by:joshld
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 31

Expert Comment

by:Helen Feddema
ID: 29220207
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.
Access-2007-Attachments.jpg
0
 
LVL 31

Expert Comment

by:Helen Feddema
ID: 29220318
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:
http://www.helenfeddema.com/Files/accarch188.zip
0
 
LVL 2

Author Comment

by:joshld
ID: 29225039
I need to know how I use the "control source" of a attachment box to select a specific field in a table.
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
LVL 42

Accepted Solution

by:
dqmq earned 500 total points
ID: 29225252
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.  










 


 








 
0
 
LVL 85

Assisted Solution

by:Scott McDaniel (Microsoft Access MVP - EE MVE )
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 29327962
Access 2007 includes an Attachment Control you can drop on the form, which will display your Attachments as clickable objects:

http://www.databasedev.co.uk/access2007attachment.html

If you need to work with Attachments via code, here's the standard for opening Attachment via VBA:
http://blogs.msdn.com/access/archive/2007/08/30/using-vba-code-to-open-a-file-stored-in-the-new-access-2007-attachment-field.aspx
0
 
LVL 42

Expert Comment

by:dqmq
ID: 29486037
>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.
0
 
LVL 2

Author Closing Comment

by:joshld
ID: 31709444
thanks
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Implementing simple internal controls in the Microsoft Access application.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
How can you see what you are working on when you want to see it while you to save a copy? Add a "Save As" icon to the Quick Access Toolbar, or QAT. That way, when you save a copy of a query, form, report, or other object you are modifying, you…
Suggested Courses

592 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question