0

I'm trying to insert an image path into an Access database. I have a hyperlink field named logo, and I'm using this code to browse for images:

Dim dialog As FileDialog
Set dialog = Application.FileDialog(msoFileDialogFilePicker)
With dialog
    .AllowMultiSelect = False
    .Title = "Select A File To Use As A Logo"
    .Filters.Clear
    .Filters.Add "Images", "*.gif; *.jpg; *.jpeg;*.bmp;*.png"
    .ButtonName = "Use This File"
    If .Show = True Then
        Me.im1 = .SelectedItems.Item(1)
    End If
End With

im1 is an unbound textbox used to view the path. The problem is that it's displaying the file path as text, not as a hyperlink. I'd like to display the file name as a hyperlink in my form in im1. Is this possible?

Sinister Beard
  • 3,570
  • 12
  • 59
  • 95
Mohammed AL Jakry
  • 69
  • 1
  • 5
  • 21
  • possible duplicate of [Access - Hyperlinks Aren't Linking](http://stackoverflow.com/questions/21581485/access-hyperlinks-arent-linking) – Gord Thompson Mar 07 '14 at 11:13

1 Answers1

0

Text is text. If you want something to show up as a hyperlink you need to tell your textbox that's what it's doing. It can't guess.

im1.IsHyperlink=True

However, The easier thing to do is probably to use a Label instead of a textbox. Set the .HyperlinkAddress property to your link address

Brad
  • 11,934
  • 4
  • 45
  • 73