L
lozzablake
Guest
I have a table with a field type set to Hyperlink. I need to be able to change the address of the hyperlink (NOT the display text). I have the following code which errors where shown. How do I set the hyperlink address of the field to the new string?
Sub ChangeHyperlink()
Dim rs As DAO.Recordset
Dim db As Database
Dim strAddress
Set db = CurrentDb
Set rs = db.OpenRecordset("tblCreditLimits1")
With rs
.MoveFirst
Do While Not .EOF
.Edit
strAddress = HyperlinkPart(.Fields("Credit Review"), acAddress)
strAddress = "..\Counterparties\Reviews\" _
& Right(strAddress, Len(strAddress) - 7)
.HyperlinkPart(.Fields("Credit Review"), acAddress) = strAddress Error Here
.update
.MoveNext
Loop
End With
End Sub
Sub ChangeHyperlink()
Dim rs As DAO.Recordset
Dim db As Database
Dim strAddress
Set db = CurrentDb
Set rs = db.OpenRecordset("tblCreditLimits1")
With rs
.MoveFirst
Do While Not .EOF
.Edit
strAddress = HyperlinkPart(.Fields("Credit Review"), acAddress)
strAddress = "..\Counterparties\Reviews\" _
& Right(strAddress, Len(strAddress) - 7)
.HyperlinkPart(.Fields("Credit Review"), acAddress) = strAddress Error Here
.update
.MoveNext
Loop
End With
End Sub