Run time error 2202

Posted on 2006-03-30
Last Modified: 2008-02-01
Hi all.

I get the following error when printing a report (it was working fine for the past 3 months until today), the report prints images with each record.

Run-time error '2220':
Microsoft Office Access can't open the file '\\path\909655.bmp'

This is the code I use to populate the image:
Option Compare Database
Option Explicit

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

If Me!Expr3 = "" Or IsNull(Me!Expr3) Then

Me!ImageFrame.Visible = 0
    Me!ImageFrame.Visible = -1
    Me!ImageFrame.Picture = Me!Expr3
End If

End Sub

The Debugger highlights the following line: Me!ImageFrame.Picture = Me!Expr3

Expr3 is the following: Expr3: IIf([ImageFile] Is Null Or [ImageFile]="","","\\win2k3-2\apps\MAS90\images\ASC\" & [ImageFile])

Any ideas?
Question by:printmedia
    LVL 34

    Assisted Solution

    Does the file in question exist?
    LVL 33

    Accepted Solution

    It seems, you have a file name in your database which no longer exists in the directory; or it may have been renamed.

    Btw, you can change your code to:

    IIf(Nz([ImageFile],"")="","","\\win2k3-2\apps\MAS90\images\ASC\" & [ImageFile])

    to do the exact same thing as your code does.


    Author Comment

    Got it! Someone renamed the file and didn't notify us. Thanks!

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    This article is a continuation or rather an extension from Cascading Combos ( and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
    Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
    In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
    In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

    734 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

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now