Results 1 to 9 of 9
  1. #1
    Kirsti is offline Competent Performer
    Windows 7 32bit Access 2003
    Join Date
    Jan 2012
    Location
    New Zealand
    Posts
    172

    Embed image on form rather than opening hyperlink in new browser

    Hi there,



    I have a button on a form, that opens a hyperlink in my browser (to view an image).

    What I want to achieve though, is to have a box on my form, and when I click the button, the image opens in the box on the form, rather than opening a new window.

    Does anyone have any thoughts on how I can make this work?

    Any help appreciated.

    Kirsti

  2. #2
    Rod is offline Expert
    Windows 7 32bit Access 2007
    Join Date
    Jun 2011
    Location
    Metro Manila, Philippines
    Posts
    679
    You need to use an Image control. In v2007 there are two options available for the property, Picture Type: 'Embedded' and 'Linked.' Refer to the drop down list in the Property Sheet.

    Embedded.

    The image is permanently embedded in the database. It inflates the database size so if this is a matter of concern, be careful. Embedded images port with the database if you move it. They are useful for things like logos.

    Linked.

    The image exists separately and has minimum impact on database size. The cautions are: that when you move the database you may also have to move the images; that other parties may move or delete the images. Linked images are useful for pictures that change from time to time (e.g. product images) and that may be under the control of another department.

    If you have a split database - front end / back end - then I would recommend that linked images are your only choice with the image file being on the back end. (Increases network traffic and slows things down but what's the alternative?)

    If you need help with either of these options then shout.

  3. #3
    Kirsti is offline Competent Performer
    Windows 7 32bit Access 2003
    Join Date
    Jan 2012
    Location
    New Zealand
    Posts
    172
    Thanks Rod - I will give it a go going down the "Linked" path, and let you know how I get on.

    Regards,
    Kirsti

  4. #4
    Rod is offline Expert
    Windows 7 32bit Access 2007
    Join Date
    Jun 2011
    Location
    Metro Manila, Philippines
    Posts
    679
    OK, do that. Here's a tip: when you first place an image control on your form in design view, Access defaults to 'Embedded' and will prompt you to browse through your directories and choose an image. Cancel this and go to the Property Sheets. There, select 'Linked' as the Picture Type (sixth property down under the Format tab). Then click the elipsis (...) alongside the Picture property (second property down) and browse through your directories to choose the image. Access converts your choice into a full directory path. This path, incidentally, may be set dynamically via VBA - but that's another story.

    Have fun!

  5. #5
    Kirsti is offline Competent Performer
    Windows 7 32bit Access 2003
    Join Date
    Jan 2012
    Location
    New Zealand
    Posts
    172
    Ok, thanks Rod. I used the image control, and chose linked image, but it is still forcing me to choose an image on my computer, and when I try to type a URL as the File name, I just get an error "The network name 'www.blahblah' could not be found" which makes sense, but there must be some way of using a URL rather than an image stored on my PC?

    Regards,
    Kirsti

  6. #6
    Kirsti is offline Competent Performer
    Windows 7 32bit Access 2003
    Join Date
    Jan 2012
    Location
    New Zealand
    Posts
    172
    Ok, I have figured out that I can use the web browser control, instead of the image control. But... does anyone know if it is possible to zoom/shrink the image to fit within the size of the control, and if so, how to do this?

    Thanks in advance.
    Kirsti

  7. #7
    Rod is offline Expert
    Windows 7 32bit Access 2007
    Join Date
    Jun 2011
    Location
    Metro Manila, Philippines
    Posts
    679
    Kirsti, forgive me, I somehow missed the fact that the 'image' is on the web. An image control is totally inappropriate.

    At present I have no idea how to fulfil your requirement. An image control is designed for artwork and a hyperlink is designed to 'jump' to the URL and open it in an appropriate application (e.g. your browser).

    If the target URL is an active web page, do you want to be able to browse it once you've displayed it or do you just want to see the image of the page? (You say in your first post they are images.)

    On the assumption that everything is an object, maybe the object frame controls could contain an instance of IE - never seen it done, never heard of it being done. Is it possible to open a Window inside Access that is running IE?

    Another thought is to use 'functions' (don't yet know what I mean by this - APIs perhaps) to retrieve the URL image and convert it to a form suitable for an Access control. I fear this may, if possible, be slow.

    While I ponder, let's open this for general discussion. Anyone out there with further thoughts?

  8. #8
    Rod is offline Expert
    Windows 7 32bit Access 2007
    Join Date
    Jun 2011
    Location
    Metro Manila, Philippines
    Posts
    679
    Hah! Just found it - WebBrowser6, an ActiveX control.

    Zooming doesn't look to hopeful. Here are some links with further info.

    http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx

    http://www.vbforums.com/showthread.p...p-and-Examples

  9. #9
    Kirsti is offline Competent Performer
    Windows 7 32bit Access 2003
    Join Date
    Jan 2012
    Location
    New Zealand
    Posts
    172
    Thanks Rod. Seeing as I've solved my original issue (i.e. displaying a URL) I will mark this thread as solved, and start a new one with regards to sizing the image.

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

Similar Threads

  1. Embed word document into form
    By jgelpi16 in forum Forms
    Replies: 4
    Last Post: 06-26-2012, 11:31 AM
  2. Replies: 9
    Last Post: 05-07-2012, 06:11 PM
  3. Opening URL Without Opening Browser
    By steve2507 in forum Access
    Replies: 0
    Last Post: 02-26-2012, 06:54 AM
  4. embed mailto in access sharepoint form
    By johnhoare65 in forum SharePoint
    Replies: 2
    Last Post: 12-23-2011, 03:00 PM
  5. embed fonts in access2007
    By rbg in forum Access
    Replies: 3
    Last Post: 12-08-2010, 03:29 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