Results 1 to 6 of 6
  1. #1
    WAVP375 is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Dayton Ohio
    Posts
    171

    Inserting an image in a form

    I have a table with a text field in the record, named "ImagePath", which contains the link to an image as follows: "C:\Users\Howard\Documents\Attachments\Greene Testimonial0001.pdf".
    I have a form, whose data source is the table, with a text box labeled "ImagePath"
    I have an Image object whose Name is "ImageFrame" and data control source is "ImagePath"
    The forms On Current event is:

    Private Sub Form_Current()
    ImageFrame.Picture = ImagePath
    End Sub

    When I look at form view I get this error message
    Document Archives cant open the file "C:\Users\Howard\Documents\Attachments\Greene Testimonial0001.pdf



    Any clue as to what I am missing

    Thanks for any assistance

  2. #2
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    not sure if it is how you have posted it but there should not be any quotation marks

    contains the link to an image as follows: "C:\Users\Howard\Documents\Attachments\Greene Testimonial0001.pdf"
    with a text box labeled "ImagePath"
    do you mean named?

    you don't need any code in the current event, just

    =[imagepath]

    in the controlsource to your image control where imagepath is the name of your control

    finally, a pdf is not an image, it needs to be a .bmp, .jpg, .png etc

  3. #3
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    Did you try loadpicture ?
    image = LOADPICTURE ( pathname)

  4. #4
    WAVP375 is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Dayton Ohio
    Posts
    171
    Still struggling with this. Where would I put the =[ImagePath] and also image = LoadPicture (PathName)

    My latest attempt, still not successful, I set the Data Source on the object control to ImagePath. Still no picture for either a jpg or bmp.

    I'm still missing something

    Thanks

  5. #5
    WAVP375 is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Dayton Ohio
    Posts
    171
    Success! After eliminating the " " around the path it finally displays the image. When I select the Copy Path item in the image folder it automatically includes the " ". Is ther a way to eliminate the quotes or is there another way to copy the path.

    You have been very helpful, Thanks

  6. #6
    WAVP375 is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Dayton Ohio
    Posts
    171
    Thanks for your help. I think I have what I need.

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

Similar Threads

  1. Replies: 1
    Last Post: 01-13-2016, 03:31 PM
  2. Replies: 3
    Last Post: 07-13-2015, 12:07 PM
  3. Replies: 2
    Last Post: 10-10-2012, 07:01 AM
  4. Replies: 3
    Last Post: 02-27-2012, 05:10 PM
  5. Inserting a Report into a Form
    By James3mc in forum Forms
    Replies: 2
    Last Post: 11-18-2009, 08:27 PM

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