Change path of multiple hyperlinks

Hayley Baxter

Registered User.
Local time
Today, 23:55
Joined
Dec 11, 2001
Messages
1,607
I have a database that contains many hyperlinks linking to various contracts, one of the users have moved the contracts into a different location.

Is there a quick way to re-establish the links without having to go into each one and do this?

Thanks
Hay
 
Hayley Baxter said:
I have a database that contains many hyperlinks linking to various contracts, one of the users have moved the contracts into a different location.

Is there a quick way to re-establish the links without having to go into each one and do this?

Thanks
Hay

Sounds like for each form in your db - you are going to have to loop through each command button, label, or image control vai the Forms Controls collection - check its hyperlink property and amend as appropriate.

How about:

Dim myForm As Form, myControl As Control
Dim myHyperlink As Hyperlink
Dim myNewHyperlink As String

myNewHyperlink = "http://www.access-programmers.co.uk"

For Each myForm In Forms

For Each myControl In myForm.Controls
If myControl.ControlType = acLabel Or myControl.ControlType = acImage or myControl.ControlType = acCommandbutton Then

Set myHyperlink = myControl.Hyperlink
If NOT myHyperlink.Address = myNewHyperlink Then
myHyperlink.Address = myNewHyperlink
End If
Set myHyperlink = nothing
End If
Next myControl
Next myForm
End Sub


or something like that :o
 
Last edited:

Users who are viewing this thread

Back
Top Bottom