ACC2000: Error Message When You Attempt to Display Images on a Form (294255)



The information in this article applies to:

  • Microsoft Access 2000

This article was previously published under Q294255
Moderate: Requires basic macro, coding, and interoperability skills.

This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).

SYMPTOMS

When you attempt to display a form in Microsoft Access, you may receive one of the following error messages:
The expression event you entered as the event property setting produced the following error: Microsoft Access doesn't support the format of the file Path To Image, so it can't load the picture.
- or -
Run-time error: 2114: Microsoft Access doesn't support the format of the file Path To File so it can't load the picture.

CAUSE

This behavior occurs if either of the following conditions is true:
  • There is no registered Automation Server capable of handling the inserted image type. For example, Microsoft Internet Explorer is capable of rendering JPG images, but it cannot process them on behalf of other programs, and therefore it can not act as an Automation Server. -or-

  • There is no filter, or there is an issue with the specific filter used to display the image type.

RESOLUTION

To work around this issue, use one of the following methods:
  • Ensure that the graphic filters are installed and functioning correctly. To do so, test the filters with another program. -or-

  • Use another computer to convert the image to an alternate format such as Graphics Interchange Format (GIF). To do so, you can use a number of graphic editors -- for example, the Microsoft Photo Editor, which can be installed from your Microsoft Office 2000 CD-ROM.

MORE INFORMATION

Steps to Reproduce the Problem

  1. Remove all JPEG (.jpg) file associations.
  2. Rename Jpegim32.flt TO Jpegim32.old.

    This file is usually located in the following folder:

    C:\Program Files\Common Files\Microsoft Shared\Grphflt

  3. Start Access and create a new database TestImage.mdb.
  4. Add the following table:
       Table: tblImage
       ----------------------------
       Field Name: ImageID
       Data Type: Text
       Field Size: 2
       Primary Key: Yes
       Indexed: Yes (No Duplicates)
    
       Field Name: txtImageName
       Data Type: Text
       Field Size: 80
    					
  5. Open the tblImage table in Datasheet view, and then add the paths for one bitmap (.bmp) image and one .jpg image in the txtImageName field. The following example shows how the records might appear on a Microsoft Windows 98-based computer:
       ImageID   txtImageName
       ------------------------------------------------------
       1         C:\Windows\Circles.bmp
       2         C:\Program Files\Common Files\Microsoft Shared\Stationery\Glacier Bkgrd.jpg
    					
  6. Create the following new form based on the tblImage table:
       Form: frmImage
       ----------------------
       RecordSource: tblImage
    
       Image Control
       ---------------------------------
       Name: ImageFrame
       Picture: "C:\Windows\Circles.bmp"
    
       Text box
       ---------------------------
       Name: txtImageName
       ControlSource: txtImageName
    						
    Note that the Picture property of the Image control has been set to the path name for the first image. The Image control must have a valid Picture property in Design view.
  7. On the View menu, click Code, and then type or paste the following code:
    Function setImagePath()
        Dim strImagePath As String
        strImagePath = Me.txtImageName
        Me.ImageFrame.Picture = strImagePath
    End Function
    					
  8. Set the OnCurrent and AfterUpdate events to =setImagePath().
  9. Open the frmImage form in Form view and move to the next record. Note that you receive one of the error messages listed in the "Symptoms" section of this article.

REFERENCES

For more information about using images in forms and other objects, click Microsoft Access Help on the Help menu, type image control in the Office Assistant or the Answer Wizard, and then click Search to view the topics returned.

Modification Type:MinorLast Reviewed:7/15/2004
Keywords:kberrmsg kbprb KB294255