Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hyperlinks in Tables

Status
Not open for further replies.

RTDesi

MIS
Apr 17, 2001
24
US
I'm trying to throw some links in tables using the 'hyperlink' datatype...basically, the field is the filename (minus the extension)...For example - the record contains the field with the entry 'file1' ..and the hyperlink would be like :
Basically, I want to have like 'file2', 'file3' etc ALL with the same directory path ( + filex + '.pdf' as the extension. As of now when I have file1 as the record..the hyperlink is
I dont know how clearly I'm conveying my issue here...but basically I want to have a fixed path to a specific folder on the LAN and attach a file extension to the end of the URL for EVERY record. Any ideas? I'll be more than happy to clarify this further if this is completely incomprehensible.
Thanks in advance
 
is this something you want to do one at a time as they are added? is this going to be a batch job? Let me know. If you are running it as a batch job let me know I had a simular situation maybe I can help.

Scoty ::) "Learn from others' mistakes. You could not live long enough to make them all yourself."
-- Hyman George Rickover (1900-86),
 
For now, a batch job will be fine. Later on I can figure out how to get it to work on the fly on a per addition basis...but like I said, for right now, ANYTHING that works would be great! Thanks in advance
 
ok Desi here you go.
Code:
Dim lrs As Recordset
Dim lsSQL As String
Dim lsHyperLink as Sting
Dim lsAddress as Sting


lsSQL = "SELECT * FROM Search" 'my table
Set lrs = CurrentDb.OpenRecordset(lsSQL)
lrs.MoveLast
lrs.MoveFirst
Do Until lrs.EOF = True
    lsAddress = "[URL unfurl="true"]http://www.something.com/science/biology/frogs/"[/URL] & _
    CStr(HyperlinkPart(lrs.Fields(0), acAddress)) & ".pdf"
    lsHyperLink = HyperlinkPart(lrs.Fields(0), acDisplayedValue) & "#" & lsAddress
    With lrs
        .Edit
         '!link =the name of the hyperlink field on my table	
        !link = lsHyperLink
        .Update
    End With
lrs.MoveNext
Loop

hth
Scoty ::) "Learn from others' mistakes. You could not live long enough to make them all yourself."
-- Hyman George Rickover (1900-86),
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top