我正在尝试将图像路径插入Access数据库。 我有一个名为logo的超链接字段,我正在使用此代码浏览图像:
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 Withim1是用于查看路径的未绑定文本框。 问题是它将文件路径显示为文本,而不是超链接。 我想在im1中的表单中显示文件名作为超链接。 这可能吗?
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 Withim1 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?
最满意答案
文字是文字。 如果你想要一些东西显示为超链接,你需要告诉你的文本框它正在做什么。 它无法猜测。
im1.IsHyperlink =真
但是 ,更容易做的事情可能是使用Label而不是文本框。 将.HyperlinkAddress属性设置为您的链接地址
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
更多推荐
发布评论