Lesson 5 – Creating an Attachment field
Attachment fields are similar to hyperlink fields but link to documents rather than websites. Various types of external files such as Excel workbooks, Word documents, PowerPoint presentations and image files can be attached to a database. Multiple documents may be attached to any record.
Tutorial Steps
Follow the steps outlined below to add and interact with an attachment field in the Panorama database.
Creating an Attachment Field
- Download and save thePanorama5.accdb,Plan1.jpg, Landscaping Agreement.docx, and Landscape PlansPresentation.pptxfiles from the Lesson 5 page.
- Open the Panorama database. Open the Contracttablein Design view.
- In a blank field underneath the Contract Type field, enter the field nameLandscapePlanFiles.
- Set the field type as Attachment.
- Save your table changes.
Adding a Caption to the Attachment Field
- Switch to Datasheet view for the Contract table.
- Scroll to the far right of the table. Notice that the default column heading for the attachment field is the Attachment symbol (paperclip). This occurs regardless of the field name entered for this field.
- Switch to Design view and select the LandscapePlanFiles field.
- Enter the following caption for this field: LandscapePlanFiles.
- Save your design changes and toggle to Datasheet view.
- The caption should now appear as the column heading. Adjust the column size to best fit so that the column heading fully displays.
Adding a Document to an Attachment Field
- Notice that each record has an attachment symbol followed by (0). This indicates that the field is an attachment field but no documents are attached to the record.
- To insert a document for Contract 3011 (record 1), double-click the attachment symbol for this record.
- Click the Add… button from the Attachments dialog box.
- Navigate to the drive that contains your downloaded files for this course.
- Double-click the Plan1.jpg file to select it. Once you press OK, an attachment to this file will be added to the record for Contract 3011.
- Before clicking OK, you will add two more documents to this record. Click the Add... button and select Landscaping Agreement.docx. Click the Add… button one more time and select LandscapePlansPresentation.pptx.
- Click OK. The Attachment field for Contract 3011 now shows that 3 files are attached to this record.
Opening an Attached File
- Double-click the attachment symbol for the Contract 3011 record. The Attachments dialog box opens. A list of all documents attached to this record is displayed.
- Double-click the Plan1.jpg link. The Plan1 image file opens.
- Close the Plan1 image window. Close the Attachments dialog box.
Deleting an Attached File
- Double-click the attachment symbol for the Contract 3011 record. The Attachments dialog box opens.
- Select the file to delete by clicking it once. Click the Remove button. Click OK.
- Click the Cancel button to close the Attachments dialog box without deleting any attachments.
Using Attachment Fields in Forms
- Close the Contract table. If asked if you want to save any changes, select Yes.
- Verify that the Contract table is selected in the Objects pane.
- From the Create tab, click Form. An autoform is created based on the Contract table.
- Notice that an icon for the PowerPoint presentation appears in the attachments field. Click the PowerPoint icon to reveal the AttachmentsNavigation bar.
- Click the green forward arrow to scroll through each attached document. Notice that the Plan1 file displays the image.
- To open the Landscaping Agreement file, display the attachment navigation bar and click the paperclip*. The Attachment dialog box displays and files can be opened by double-clicking the desired file.
*Alternate Method: Ensure you are in Form view and double-click any file icon. The Attachments dialog box displays. - Close the Landscaping Agreement file. Close the Attachments dialog box.
Changing the Displayed Icon for the Attachments Field
- Ensure you are in Layout view. With the attachments field selected, right-click the field. Click Properties from the pop-up menu.
- On the Property Sheet, make sure the Format tab is selected.
- Click the drop-down arrow on the right side of the DisplayAs property.
- Select Paperclip from the options list and close the Property Sheet.
- Notice that the attachment field now displays a paperclip with the number of attachments in parentheses.
- Double-click the paper clip to display the Attachments dialog box. Close the Attachments dialog box.
- Save the form as ContractFrm.
- Close the Panorama 5 database.
Page 1 of 5