Results 1 to 2 of 2
  1. #1
    ringram is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2014
    Posts
    16

    run-time error 2220. can't open the file. but the file exist

    I am back again. I am building a database that will store several different types of images related to equipment and operators.
    I am working on the very first form in the database to add an operator and a related image of the operators licences ( don't have the actual images yet so I am just using some sample jpg file.
    On the Add_new_operator form I have a combobox that gets the file currently in a directory below where the application is located


    (this works fine)
    After the user select the image file they want to link to the operator I am trying to open a form that will display the image to make sure the user selected the correct image.
    Code:
    Me.image_path = Application.CurrentProject.Path & "\" & Forms![Add_new_operator]![Simage]
    
    Me![image_path].SetFocus
    Me![viewimage].Picture = Me![image_path].Text
    The filed me.image_path is getting the correct value but when I try to open the file in the image object I get run-time error 2220 can not open the file even though the file exist.

    I have never worked with images in access before so I am clueless.
    this is giving me a headache.

  2. #2
    ringram is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2014
    Posts
    16
    I am an idiot. The path was not quit correct. the images were located in a subdirectory of Application.CurrentProject.Path & "\"
    have a good weekend I know I will having cracked this nut.


Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 09-15-2014, 10:31 AM
  2. Replies: 6
    Last Post: 11-08-2013, 11:18 AM
  3. Intercepting error codes like 2220, file not found
    By justphilip2003 in forum Programming
    Replies: 4
    Last Post: 04-21-2013, 11:33 AM
  4. Import Excel file based on a date and time in file name
    By nhylan in forum Import/Export Data
    Replies: 4
    Last Post: 04-16-2013, 03:26 PM
  5. Replies: 1
    Last Post: 09-27-2010, 10:10 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums