Results 1 to 7 of 7
  1. #1
    New Lounger
    Join Date
    Oct 2002
    Location
    Cleveland, Ohio, USA
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Hyperlink in Report (Version 2k SR1)

    Is there any way to have a hyperlinked .jpg appear as the picture, not the link, in an Access report?

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

    Re: Hyperlink in Report (Version 2k SR1)

    Put an image control in the report, and use code to set its Picture property to the path stored in the hyperlink. The HyperlinkPart function with the acAddress argument retrieves the address/path: HyperlinkPart([fieldname], acAddress).

    Here is an example of code you could use for the OnFormat event of the detail section. The hyperlink field is named PicFile, and the image control is named imgPicture:

    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    On Error GoTo Err_Sub
    If IsNull([PicFile]) Then
    [imgPicture].Visible = False
    [imgPicture].Picture = ""
    Else
    [imgPicture].Visible = True
    [imgPicture].Picture = HyperlinkPart([PicFile], acAddress)
    End If
    Exit Sub
    Err_Sub:
    If Err = 2220 Then ' Can't open file
    [imgPicture].Visible = False
    [imgPicture].Picture = ""
    Else
    MsgBox Err.Description, vbExclamation
    End If
    End Sub

  3. #3
    New Lounger
    Join Date
    Oct 2002
    Location
    Cleveland, Ohio, USA
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hyperlink in Report (Version 2k SR1)

    Thanks for your reply, Hans. Being a novice of sorts when it comes to Access, and NOT at all at ease with Visual Basic, I had to find out exactly what you were telling me to do, and where to do it! When I tried to use your solution as you had posted it, I got an error "object doesn't support this property or method."

    I didn't give you enough information to adequately answer my question. I had a multi-page report with one record and its matching, hyperlined picture on each page. So there was more than one record to hyperlink in the report. Perhaps that made a difference to your solution?

  4. #4
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Hyperlink in Report (Version 2k SR1)

    Hi Dianne
    I think you should change your Bio, especially when you start to get help from Charlotte, Wendell, Hans, Rory, etc.....
    Han's solution should work for each record as his code is for the Detail section.
    Pat <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

  5. #5
    Star Lounger
    Join Date
    Aug 2001
    Location
    Cleveland, Ohio, Ohio, USA
    Posts
    76
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hyperlink in Report (Version 2k SR1)

    Hans,
    Apperently I missed something. In trying to apply your suggestion to Dianne, I get an error message when we attempt to view the Report pages. The message is "Microsoft Access does not support the format of the file TT-1006B.JPG, so it can't load the picture." Do I need a Reference loaded that possibly I'm not currently using, or what?

    In looking at Help on JPG files, it says that I would need to install graphics filters unless I'm using MS Office Pro, which I am so I'm lost.

    Thanks,
    Jim <img src=/S/sad.gif border=0 alt=sad width=15 height=15> <img src=/S/stupidme.gif border=0 alt=stupidme width=30 height=30>

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

    Re: Hyperlink in Report (Version 2k SR1)

    You might do a bit of testing. Before you start, make sure you know the location of some graphics files - at least one bitmap file (.bmp), one jpeg file other than TT-1006B.jpg, and TT-1006B.jpg itself.
    1. <LI>Create a new blank database; name and location aren't important.
      <LI>Create a new blank report (no record source) in design view.
      <LI>Put an image control on the report. You should get a File Open dialog that lets you select a graphics file.
      <LI>The file type dropdown box should read something like Graphic files followed by a list of extensions you can't see completely, but in any normal installation, *.bmp should be included even if you can't see it.
      Find and select a .bmp file and click OK.
      <LI>If you get an error message, there is something wrong - you should be able to display bitmap files at the very least. You probably need to repair your Office installation to include all available graphics filters.
      <LI>If the bitmap file displayed correctly, activate the Properties window (with the image control still selected).
      <LI>Click the Builder button (the three dots) to the right of the Picture property. The File Open dialog should display again.
      <LI>In the file type dropdown list, select JPEG format (*.jpg). If this item is not present, you need to repair your Office installation to include all available graphics filters. For the moment, select All files (*.*) in the list.
      <LI>Find and select a .jpg file other than TT-1006B.jpg and click OK.
      <LI>If you get an error message, same story: you need to repair your Office installation.
      <LI>If the .jpg file displayed correctly, click the Builder button again.
      <LI>Find and select TT-1006B.jpg and click OK.
      <LI>If you get an error message, there may be a problem with this particular .jpg file.
      <LI>If the file displayed correctly, the code you copied from the Lounge should have caused no problems; there may be something else in your database that causes it.
    Hopefully, you will be able to pinpoint the cause of the problem more precisely.

  7. #7
    Star Lounger
    Join Date
    Aug 2001
    Location
    Cleveland, Ohio, Ohio, USA
    Posts
    76
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hyperlink in Report (Version 2k SR1)

    Hans,
    Thank You very much for your time and effort. Apperently it boils down to something wrong with the files. I have been able to use other JPG's along with WPG, PCX, and BMP files without problems. I have run Repair twice and am still not able to use the paticular set of JPG files. I have also tried resaving the files as a JPG under a different name using MS Photo Editor and Corel Photo House with no success. I really do not understand why I can use other JPG's and not this paticular set. These JPG photos were taken with a camara, but I do not know just how they were saved to the network folder. I am trying to set up this report at home not where we need it and there are about 175 JPG files which would be needed with the reports. I will give it a try at the PBS TV station the next time I'm there to see if there is anything different.

    Thanks Again,
    Jim <img src=/S/surrender.gif border=0 alt=surrender width=31 height=23>

Posting Permissions

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