changing Hyperlink Address

  • Thread starter Thread starter lozzablake
  • Start date Start date
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
 
HyperlinkPart belongs to the application not to the record set, try removing the full stop prefixing it.

HyperlinkPart(.Fields("Credit Review"), acAddress) = strAddress

HTH

Peter
 

Users who are viewing this thread

Back
Top Bottom