Results 1 to 9 of 9
  1. #1
    Star Lounger
    Join Date
    Jun 2004
    Location
    Lambertville, New Jersey, USA
    Posts
    82
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Linked images (2002)

    I am attempting to display an image on a form. The path/filename of the image to display is stored in the current record (txtImageName) and changes for every record. I'm using a bound object frame to display the picture. I need to be able to blank out the image for records where the filename is null. I have the following code running on the Current Event. Can anyone tell me how to blank out the picture when the file name is null?
    Here is my existing code:

    If Me!txtImageName <> "" Then
    OLEBoundJpg.OLETypeAllowed = acOLELinked
    OLEBoundJpg.SourceDoc = txtImageName
    OLEBoundJpg.Action = acOLECreateLink
    OLEBoundJpg.SizeMode = acOLESizeZoom
    Else
    What goes here???
    End If

    Thanks,
    Lance

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Linked images (2002)

    You shouldn't use a bound OLE control or even an unbound OLE control for this, but an (unbound) Image control. See the attachment to <post#=296892>post 296892</post#> for an example of how to handle images. It demonstrates how to deal with null values in the txtImageName field.

  3. #3
    Star Lounger
    Join Date
    Jun 2004
    Location
    Lambertville, New Jersey, USA
    Posts
    82
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Linked images (2002)

    Thanks Hans;
    I was hoping you would be the one to respond.
    Unfortunately, I cannot open the db. After unzipping it, I attempt to open the db and get the message:
    "The file is located outside your intranet or on an untrustrated site. Microsoft Access will not open the file due to potential security problems. To open the file, copy it to your machine or an accessible network location."

    Any suggestions?
    Thanks,
    Lance

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Linked images (2002)

    Right-click the .mdb file in Windows Explorer.
    Select Properties from the popup menu.
    Click the button labeled Unblock near the bottom of the dialog.
    Click OK.
    You should now be able to open the database.
    Access will prompt you whether you want to convert it or to open it. Choose Convert.

  5. #5
    New Lounger
    Join Date
    Aug 2005
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Linked images (2002)

    How do you get an unbound image control on a form? I can't find it in the tool box. I've tried an image control and an unbound object frame, but they don't do what I want them to do.

    The only way I can get this to work is to copy the control on your form and then paste it to my form. That works, but I'd like to know how to do it using the tool box.

    Thanks for any enlightenment!

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Linked images (2002)

    It's the standard Image control
    Attached Images Attached Images
    • File Type: png x.png (4.6 KB, 1 views)

  7. #7
    New Lounger
    Join Date
    Aug 2005
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Linked images (2002)

    When I use the standard image control, it opens a dialog box and makes me select a picture file.
    Then that picture appears in the control.
    When I change the Picture property for the image control to (none), it asks if I want to remove the picture.
    If I click Yes, the picture is removed, but so is the control.
    If I click No, I'm stuck with the picture I selected when setting up the control.

    How did you get the Picture property set to (none)?

    Thanks!

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Linked images (2002)

    When I clear the Picture property of an Image control and confirm that I want to remove the picture, I am left with an empty frame -see screenshot below. This is in Access 2002 SP3.
    Attached Images Attached Images
    • File Type: png x.png (1.6 KB, 1 views)

  9. #9
    New Lounger
    Join Date
    Aug 2005
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Linked images (2002)

    Yes, this is working!
    Thank you very much!

Posting Permissions

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