derekstewart
MIS
I'm working on a database that allows users to click on a button and browse for files to attach files (usually excel) to a form that will later be used in specific projects. Once they click on the file I have the path to the file they chose saved in a text box on the form and the "Attachments" table behind the form. The datatype of the attachment field in the table is set to hyperlink. The second step occurs when another group of users begin work on the project (usually a week or so later) and need to pull up the attached file to begin their work.
The file picker actually works well, I just can't get the hyperlink to work. It is showing up on the form in the textbox underlined in blue and when I roll over the path the cursor turns into a hand, typical of a hyperlink. I just need the users to click on the link in textbox on the form and have the files open. Any thoughts? I'm sure it is quite a bit easier than the filepicker, I'm just stuck. Here's my filepicker code which again is working.
Private Sub attach1_Click()
Dim fd As FileDialog
Set fd = Application.FileDialog(msoFileDialogFilePicker)
Dim vrtSelectedItem As Variant
With fd
If .Show = -1 Then
For Each vrtSelectedItem In .SelectedItems
Attachment1 = vrtSelectedItem
Next vrtSelectedItem
Else
End If
End With
Set fd = Nothing
End Sub
The file picker actually works well, I just can't get the hyperlink to work. It is showing up on the form in the textbox underlined in blue and when I roll over the path the cursor turns into a hand, typical of a hyperlink. I just need the users to click on the link in textbox on the form and have the files open. Any thoughts? I'm sure it is quite a bit easier than the filepicker, I'm just stuck. Here's my filepicker code which again is working.
Private Sub attach1_Click()
Dim fd As FileDialog
Set fd = Application.FileDialog(msoFileDialogFilePicker)
Dim vrtSelectedItem As Variant
With fd
If .Show = -1 Then
For Each vrtSelectedItem In .SelectedItems
Attachment1 = vrtSelectedItem
Next vrtSelectedItem
Else
End If
End With
Set fd = Nothing
End Sub