Results 1 to 8 of 8
  1. #1
    Join Date
    Dec 2004
    Posts
    46

    Unanswered: linked image printing in a report, error!!

    Run-time error '2220':
    Microsoft Office Access cant open the file '#c:\my web sites\media\543.bmp#'.


    Option Compare Database
    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    Me![imageframe].Picture = Me![imagepath]
    End Sub


    The above is an error I get when trying the methods used in various threads to display a linked image in the report. I have tried different methods of renaming the files in the table itself, i.e \\server\C\filename.bmp, etc.

    It always gives the top error, the original code is located underneath and it highlights the line starting with Me! - any suggestions?

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    not sure about Me![imageframe].Picture = Me![imagepath]

    just a guess
    it looks like you are using the wrong operator

    Me.imageframe.Picture = [imagepath]

    I'd expect the ! to be used when referencing a column in a recodset, or item in a forms or reports collection

    what is setting the imagepath - where is it coming from. my stab above is assuming that imagepath is a column in the bound recordsource or a bound control

  3. #3
    Join Date
    Dec 2004
    Posts
    46
    It's a report based on a basic table called "imagetable" with the following fields:

    Cat, Desc, Price ex, imagepath

    Imagepath is the field where the path and full name of the image is shown.

  4. #4
    Join Date
    Dec 2004
    Posts
    46
    Just tried your code and it gives the same error message....nearly there tho, at least it's looking for the image by returning the path name.

  5. #5
    Join Date
    Aug 2002
    Location
    Melbourne, Australia
    Posts
    111
    Have a look at the attached sample (not all my work) it may help you.

    After you open it, go to tables open the table (only 1) and remove my info and put you own in and it will work . The print button on the form only gives you a preview.


    Let me know how you go.
    Attached Files Attached Files
    Regards,



    John A

  6. #6
    Join Date
    Dec 2004
    Posts
    46
    fantastic - problem solved.

    I found out what my problem was, because i got all the info from a different database, when i cut and paste, there were invisible # on the ends which appeared when i plucked the info out of the table and then put into a notepad, etc.

    Cheers

  7. #7
    Join Date
    Dec 2004
    Posts
    46

    Still minor problems

    PictureNotAvailable:

    strImagePath = "C:\accessimages\NP.jpg"
    Me.ImageFrame.Picture = strImagePath

    End Function

    It works, but when trying to view the next page it gives the same message saying it cant find accessimages\NP.jpg
    I changed the NP.jp to something which exists, but still gives the message.

  8. #8
    Join Date
    Aug 2002
    Location
    Melbourne, Australia
    Posts
    111
    Find this:

    strImagePath = "C:\accessimages\NP.jpg"

    and change it to:


    strImagePath = "C:\FolderOnYourDrive\NP.jpg"

    This line appears twice in the db once in behind the form On Current and In the report On format (Detail)

    In my db I put a ? from clip art and changed the ext to jpg, all it does is show this jpg if it can't find the one that is in the table.
    Regards,



    John A

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •