J
JustinP
I am using a file picker dialog to get the file path and record it in a
hyperlink field. This works, however the hyperlink does not hyperlink.
When I click on the hyperlink in the table it does nothing but when I
go to the end of the hyperlink and press delete a few times it does
work (as if there are empty spaces that are preventing it from working.
I've tried using trim but it doesn't work. Any suggestions? (code
included below)
Sub Main()
Dim fd As FileDialog 'Declare a variable as a FileDialog object
Set fd = Application.FileDialog(msoFileDialogFilePicker)
Dim vrtSelectedItem As Variant
With fd
If .Show = -1 Then
For Each vrtSelectedItem In .SelectedItems
If IsNull(Me![Link1]) Then
Me![Link1] = Trim(vrtSelectedItem)
ElseIf Not IsNull(Me![Link1]) And IsNull(Me![Link2]) Then
Me![Link2] = Trim(vrtSelectedItem)
End If
Next vrtSelectedItem
Else
End If
End With
Set fd = Nothing
End Sub
hyperlink field. This works, however the hyperlink does not hyperlink.
When I click on the hyperlink in the table it does nothing but when I
go to the end of the hyperlink and press delete a few times it does
work (as if there are empty spaces that are preventing it from working.
I've tried using trim but it doesn't work. Any suggestions? (code
included below)
Sub Main()
Dim fd As FileDialog 'Declare a variable as a FileDialog object
Set fd = Application.FileDialog(msoFileDialogFilePicker)
Dim vrtSelectedItem As Variant
With fd
If .Show = -1 Then
For Each vrtSelectedItem In .SelectedItems
If IsNull(Me![Link1]) Then
Me![Link1] = Trim(vrtSelectedItem)
ElseIf Not IsNull(Me![Link1]) And IsNull(Me![Link2]) Then
Me![Link2] = Trim(vrtSelectedItem)
End If
Next vrtSelectedItem
Else
End If
End With
Set fd = Nothing
End Sub