Hello all,
I have a table with about 1000 hyperlinks stored in it. I need to change the address to the relative drive on each one (right now they are pointed to the network drive). So what I have tried to do is create a record set and use the edit and update features (throuh a loop). But I keep getting an error stating Item Not Found In Collect. I know this means that the field name does not exist in the recordset. My problem is I dont know how to get the the acAddress of the hyperlink. Here is my code:
'this is where I get my
'error (of course because there is no field call Hyperlinkpart
'this was added because I have 2 network drives with the
'same info except this is one (unlike the above) is not read
'only..so I figured I would kill two birds with one stone
Any Help would be greatly appreciated
Thanks
Scotty :
Learn from others' mistakes. You could not live long enough to make them all yourself."
-- Hyman George Rickover (1900-86),
I have a table with about 1000 hyperlinks stored in it. I need to change the address to the relative drive on each one (right now they are pointed to the network drive). So what I have tried to do is create a record set and use the edit and update features (throuh a loop). But I keep getting an error stating Item Not Found In Collect. I know this means that the field name does not exist in the recordset. My problem is I dont know how to get the the acAddress of the hyperlink. Here is my code:
Code:
Dim lrs As Recordset
Dim lsSQL As String
Dim lsHyperLink as Variant
lsSQL = "SELECT * FROM Search"
Set lrs = CurrentDb.OpenRecordset(lsSQL)
lrs.MoveLast
lrs.MoveFirst
Do Until lrs.EOF = True
If Left(CStr(HyperlinkPart(lrs.Fields(0), acAddress)), 18) = "\\MyNetwork\Server\" Then
lsHyperLink = "j:" & _
Mid(CStr(HyperlinkPart(lrs.Fields(0), acAddress)), 17, Len(HyperlinkPart(lrs.Fields(0), acAddress)))
With lrs
.Edit
!HyperlinkPart(lrs.Fields(0), acAddress) = CVar(lsHyperLink)
'error (of course because there is no field call Hyperlinkpart
Code:
.Update
End With
End If
'same info except this is one (unlike the above) is not read
'only..so I figured I would kill two birds with one stone
Code:
If Left(CStr(HyperlinkPart(lrs.Fields(0), acAddress)), 16) = "\\MyOtherNetwork\Server\" Then
lsHyperLink = "j:" & _
Mid(CStr(HyperlinkPart(lrs.Fields(0), acAddress)), 15, Len(HyperlinkPart(lrs.Fields(0), acAddress)))
With lrs
.Edit
!link(HyperlinkPart(lrs.Fields(0), acAddress)) = CVar(lsHyperLink)
.Update
End With
here:
End If
lrs.MoveNext
Loop
End Sub
Thanks
Scotty :
Learn from others' mistakes. You could not live long enough to make them all yourself."
-- Hyman George Rickover (1900-86),