changing Hyperlink Address (1 Viewer)

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
 

Bat17

Registered User.
Local time
Today, 18:38
Joined
Sep 24, 2004
Messages
1,687
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

Top Bottom