2014-03-07 54 views
0

我試圖插入一個圖像路徑到Access數據庫。我有一個名爲logo超鏈接字段,我使用這個代碼瀏覽圖像:作爲超鏈接在Access數據庫中插入圖像

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是用來查看該路徑未綁定文本框。問題在於它將文件路徑顯示爲文本,而不是超鏈接。我想在im1的表單中顯示文件名作爲超鏈接。這可能嗎?

+0

可能重複的[Access - 超鏈接不鏈接](http://stackoverflow.com/questions/21581485/access-hyperlinks-arent-linking) –

回答

0

文字是文字。如果你想要顯示一些超鏈接,你需要告訴你的文本框它正在做什麼。它無法猜測。

im1.IsHyperlink =真

然而,就越容易的事情可能是使用一個標籤,而不是一個文本框。設置.HyperlinkAddress屬性爲您的鏈接地址