473,401 Members | 2,146 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 software developers and data experts.

Hyperlink walkthrough

I am trying to go through a list of files in a folder and then add a
hyperlink to each one in a table.

I am having a difficult time figuring out how to add that link into the
table and do it in such a way that the entire path isn't displayed in
the record, just the document name (just like I can make it look if I
add the hyperlink by hand and then edit it using the dialog.)

I have tried figuring it out using this article: (but I still don't get
it)
http://msdn.microsoft.com/archive/de...plications.asp

Could someone kindly walk me through how to get from having a String
with my file path stored in it, to adding it to my table, such that the
link only displays the document name and not the full path?

Thank you,

Jody Blau

Jan 30 '06 #1
2 1734
It would be easier to makit specific for you if we knew your table tructure
but here's an example which will hopefully make som sense.

The table structure I used or this example was
tlHyperLink
---------------
Name DataType
ID AutoNumber
File Hyperlink

The following actually adds the value to th table:-

Sub AddHyperLink( _
Tablename As String, _
FieldName As String, _
Hyperlink As String, _
DisplayText As String _
)
Dim db As DAO.Database
Dim strValue As String
Dim strSQl As String

Const ELEMENT_SEP = "#"

If Len(DisplayText) < 1 Then
DisplayText = Hyperlink
End If

strValue = DisplayText & ELEMENT_SEP & Hyperlink & ELEMENT_SEP

strValue = Replace(strValue, "'", "''", Compare:=vbTextCompare)

strSQl = "INSERT INTO [" & Tablename & "] ([" _
& FieldName & "]) VALUES ('" _
& strValue & "')"

CurrentDb.Execute strSQl
End Sub

The following is an example of adding the entire contentsof a folder

Function wut()
Dim strFile As String
Const FOLDER_PATH = "D:\Projects\Pinnacle\Tools\Automation
Wizard\Audit\"

strFile = Dir(FOLDER_PATH & "*.txt")
Do While Len(strFile) > 0
Call AddHyperLink("tlHyperLink", "File", FOLDER_PATH & strFile,
strFile)
strFile = Dir
Loop
End Function
If you have one filename you could do the folloing
Call AddHyperLink("tlHyperLink", "File", YourFileName,
Dir(YourFileName))


--

Terry Kreft
"jodyblau" <jo******@gmail.com> wrote in message
news:11*********************@g49g2000cwa.googlegro ups.com...
I am trying to go through a list of files in a folder and then add a
hyperlink to each one in a table.

I am having a difficult time figuring out how to add that link into the
table and do it in such a way that the entire path isn't displayed in
the record, just the document name (just like I can make it look if I
add the hyperlink by hand and then edit it using the dialog.)

I have tried figuring it out using this article: (but I still don't get
it)
http://msdn.microsoft.com/archive/de...plications.asp
Could someone kindly walk me through how to get from having a String
with my file path stored in it, to adding it to my table, such that the
link only displays the document name and not the full path?

Thank you,

Jody Blau

Jan 30 '06 #2
That worked great, thank you so much.
Jody Blau

Jan 31 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Deltones | last post by:
Hi all, I'm just getting into Python/wxPython/Pythoncard and I'm trying the tutorial from this page: http://pythoncard.sourceforge.net/walkthrough1.html Is it me who's totally dense or...
1
by: Badboy36 | last post by:
Hello user from googlegroups, i made a microsoft access database with front and backend. i created the backend in microsoft access97. for the frontend i made two versions (one for microsoft...
0
by: Ryan Harvey | last post by:
Hi all, I have written a web user control that contains a repeater control. the ItemTemplate for this control is basically 6 Hyperlinks in a row, that are dynamically allocated one of 7 gif...
5
by: Martin Dew | last post by:
Having some problems getting a hyperlink object to work in my repeater control, It displays the text I have asked it to for the hyperlink, but it does not act as a link. My repeater code is below...
5
by: Tarun Mitra | last post by:
I have not been able pass the parameter with a space in an hyperlink on a ..aspx page something like <asp:HyperLink NavigateUrl="http://localhost/syskiosk/test.exe John" id="hlEditDetails"...
0
by: Amrit Kohli | last post by:
I am trying to get through the XML Web Services Walkthrough at this location: ...
9
by: dennist685 | last post by:
Walkthrough: Creating a Web Page to Display Access Database Data I've started the above walkthrough. However, near the beginning it gives the following instructions To set permissions in the...
7
by: John D'oh | last post by:
Hello, I have been going through the MSDN Walkthrough: Creating a Windows Forms Control That Takes Advantage of Visual Studio Design-Time Features. Everything was going fine and I was able to...
20
by: tshad | last post by:
I had posted this problem earlier and just noticed that the Hyperlink is the problem. Apparently, it doesn't figure out the path correctly. It uses the path of the file it is in, even if it is...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.