How to Insert a Picture, Graph, or Microsoft Office Document into an Access Database

By eHow Computers Editor

Rate: (21 Ratings)

You can insert a picture, sound, video file, graph or Microsoft Office document into an Access database. You must first create a OLE Object datatype field, then insert your "objects" (sounds, pictures and so on) into the field. These instructions apply to MS Access 97.

Instructions

Difficulty: Moderately Easy

Things You’ll Need:

Create an OLE Object Datatype Field

Step1
Open a table in Design view.
Step2
Click in the field that you want to use for the "objects," as they are called. If necessary, create a new field.
Step3
Name your field.
Step4
Click in the box to the immediate right of the field name you just created. A small arrow appears to the right hand side.
Step5
Click in the arrow to receive a list of menu choices.
Step6
Select OLE Object.
Step7
Save your table.

Create a New Object to Insert in the OLE Object Datatype Field

Step1
After creating your OLE Object field, change to Datasheet view.
Step2
Locate the OLE Object field where you want your picture or other object to go.
Step3
With the cursor in the field, open the Insert menu and select Object.
Step4
From the window that appears, click on Create a New Object.
Step5
Select the object type in the Type window that appears. (chart, bitmap image, video clip, Word document and so on.)
Step6
To display the object as a clickable icon that will launch the file, put a check besides Display as Icon. If you want the text name of the object type to appear instead, leave the icon checkbox blank.
Step7
Click OK.
Step8
The software application will open. Create the file you want to insert in the database.
Step9
When your object file is complete, go to the File menu and select Exit and Return to "Your Table" (your table will be named).
Step10
Return to the table to see that an icon or text entry now appears in the field you used. Click on that entry to launch the object you just created.

Insert an Existing File as the OLE Object

Step1
Follow steps 1, 2, and 3 from the instructions above.
Step2
Put a checkmark beside Create Object from Existing File.
Step3
Click on the Browse button, then move through the folders and files on your disk until you find the one that you want to use. Select that file.
Step4
Click Open.
Step5
Now you must decide whether to embed the file or whether to link to the file. If you link, you can make changes to the linked file and those changes will be reflected in your database object. If you do not link, the embedded object will not reflect future changes that you make.
Step6
Click in the Icon checkbox if you want an icon to appear in your data field. If you prefer the text name instead of the icon, leave the Icon checkbox blank.
Step7
Click OK.

Tips & Warnings

  • If you link a file, you must continue to store that file in the same location. MS Access will not be able to display the file if you move or delete it. You must also include the linked file if you send your database to someone else or make a copy on a disk, etc.
  • Files inserted as embedded objects will use more system resources than a linked file.

Comments

| View All Comments
Flag This Comment

on 6/4/2008 Great blog with lots of useful information and excellent commentary! Thanks for sharing.

http://www.1-satellite-tv-facts.com/Direct-TV.html
http://www.1-satellite-tv-facts.com/Dish-Network.html
http://www.1-satellite-tv-facts.com/Satellite-Radio.html
http://www.1-satellite-tv-facts.com/T1-Internet-Service.html
http://www.1-satellite-tv-facts.com/Satellite-DSL.html
http://www.1-satellite-tv-facts.com/Satellite-Internet.html
http://www.1-satellite-tv-facts.com/VoIP.html
http://www.1-satellite-tv-facts.com/Phone-Systems.html
http://www.1-satellite-tv-facts.com/Affiliate-Programs.html

Anonymous

Anonymous said

Flag This Comment

on 12/27/2007 This code will automate your Bound Object Field with the simple click of a button. All you have to do is make sure the picture name ("12345.bmp") is the same as the unique identifier. This helps with the process of implementing a different picture for every record. Like a member program, this will hold the picture of your corresponding record. This is very clean, and it works very well. You can manipulate this code to work with any kind of object.

Code:

Private Sub cmdOleAuto_Click()
On Error GoTo Error_cmdOleAuto_Click
With Me![OLEMempic]
.Enabled = True
.Locked = False
' Specify what kind of object can appear in the field.
.OLETypeAllowed = acOLELinked
' Class statement--optional for Excel worksheet.
.Class = ".bmp"
' Specify the file to be linked.
' Type the correct path name.
'C:\\Casey's Stuff\\Photos\\DB Photo Shots\\ApprenticeNumber
.SourceDoc = "C:\\\\" & Me![UniqueNumber] & ".bmp"
' Range statement--optional for Excel worksheet.
.SourceItem = ""
' Create the linked object.
.Action = acOLECreateLink
' Optional size adjustment.
.SizeMode = acOLESizeStretch
End With
Exit_cmdOLEAuto_Click:
Exit Sub
Error_cmdOleAuto_Click:
MsgBox CStr(Err) & " " & Err.Description
Resume Exit_cmdOLEAuto_Click

End Sub

View All

Post a Comment

POST A COMMENT

Request a New How-To Article

Looking for more How To information? Chances are there’s an eHow member who knows how to do what you’re looking to do. Submit an article request now!

eHow Article:  How to Insert a Picture, Graph, or Microsoft Office Document into an Access Database

eHow Computers Editor

eHow Computers Editor

Category: Computers

Articles: See my other articles

Related Ads