Need help creating hyperlinks automatically

K

kittana514

I have a database with several tables. One table is set just for
links to documents that will be stored on the local computer.

Access 2007

tblScan

ScanID - pk Autonumber
fkCSUID - one-to-many relationship to main table
App - Hyperlink
Essay - Hyperlink
Trans - Hyperlink

Since I haven't had much experience with the hyperlink field I did
some good 'ole net searching for info and found this code edited for
one field (for testing) - I will be using it to update all three
hyperlink fields on the user form (which will end up being a subform
on the main data entry form).

I would like to be able to enter the ID in and have it set the
hyperlinks to the 3 pdf files in the directory.

I am getting Run-time Error '438':
Object doesn't support this property or method

Private Sub fkCSUID_AfterUpdate()
Dim strFile As String
Const conPath = "C:\Documents and Settings\5555\My Documents\Scanned
Documents\"

If Not IsNull(Me.fkCSUID) Then
strFile = conPath & Me.fkCSUID & " Application.pdf"

If Len(Dir$(strFile)) > 0 Then
Me.Application = strFile & "#" & strFile & "#" <-- STOPS HERE
Else
Me.Application = Null
End If
End If

End Sub

I looked in the Local window to make sure the strFile & conPath were
being passed correctly

Hopefully someone can direct me to the resolution.

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top