Transferring text from one field to a hyperlink field

Erik

Registered User.
Local time
Today, 22:50
Joined
May 16, 2000
Messages
19
I have a database in which a query creates a text entry in a field which is used to show the path to a linked file. This path needs to be transferred to an adjacent field in the form in view which is a Hyperlink field. One can simply copy and paste this text and the link works. However, if I use the SetValue function, it does not work, apparently because the text is copied and strictly text and not hyperlinked text.

I'm wondering if I can use the SendKeys action to simulate the user copying text in the first field and then another SendKeys action in the next field to simulate pasting the text in the Hyperlink field.

OR: Does anyone have any suggestions on how I can copy something like "D:\filename.doc" to another Hyperlinked field on the same form.

Merry Christmas everyone from Lake Nebagamon, WI.

Erik Cross
 
Erick,
I use the code below to create and follow a hyperlink from a list box line the user has dblclicked. "Command44" is not visible on the form. In truth, I don't think it has to physically exist but since it NOT VISIBLE, I can put it anywhere out of the way.

Dim ctl As CommandButton, i As Integer
Set ctl = Me!Command44
With ctl
If IsNull(Me!Text56) = False Then
.HyperlinkAddress = Me!Text56
End If
If .HyperlinkAddress = "" Then
GoTo out
End If
.Hyperlink.Follow True
End With
out:
End Sub


In another application I use the following function to create a hyperlink from a text variable.


Function makelink(strjpr As String) As String
'Create a hyperlink address to a JPR document. Allow user to select English
'or Spanish version if both are available.

Dim sel As String * 1, msgx As String, tx As String, pathe As String, paths As String
tx = "JPR Data System"
msgx = "The JPR you have selected to open is available" & Chr(10) _
& "English and Spanish. Which one do you want to open?" & Chr(10) _
& "Enter 'E','e' (ENGLISH) - 'S','s' (Spanish):"
pathe = makedocpath(strjpr, 1)
If testpath(pathe) = False Then
makelink = ""
GoTo out
End If
paths = makedocpath(strjpr, 2)
If testpath(paths) = True Then
sel = InputBox(msgx, tx, "E")
If UCase(sel) = "S" Then
makelink = paths
GoTo out
ElseIf UCase(sel) = "E" Then makelink = pathe
Else
makelink = ""
End If
Else
makelink = pathe
End If
out:
End Function

Note: the function "makedocpath" called above simply truncates a drive and/or folder onto the front end of the text variable.

Some combination of this stuff should solve the problem?
 
Bill:

Thanks - your code worked beautifully - and I really appreciate your help.

Erik Cross
 

Users who are viewing this thread

Back
Top Bottom