How to allow user to automatically link file?

G

Guest

I have created a BOM database with a large number of part numbers. Each part
number has a drawing that is in .pdf format. Is there any way I can make it
easy for the database user, via a form, add a hyperlink to the drawing
location (e.g. - S:\Engineering\Drawings\000001.pdf). The drawings will
always be located in the ..\Drawings file. Currently, my parts list table
has a field available for drawing numbers, and I would like make this field a
hyperlinke field that automatically opens the Acrobat file when clicked.

Also, please assume that I'm an idiot when it comes to coding (I am), but
that I might be able to hack'n'slash my way through VBA if I have to (I have).

MUCHOS GRACIAS for any help you can provide.
 
G

Guest

Hi Arvin,

This helped, but now I'm getting an error when I attach the code to my
button in my form. The error message I get is: "Compile error: Sub or
Function not defined" and it highlights the ahtAddFilterItem portion of my
code for the following code lines:

Private Sub Open_Save_Loc_Click()

Dim strFilter As String
Dim strInputFileName As String

strFilter = ahtAddFilterItem(strFilter, "Acrobat Files (*.PDF)", "*.PDF")
strInputFileName = ahtCommonFileOpenSave( _
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input file...", _
Flags:=ahtOFN_HIDEREADONLY)


End Sub

Remember when I said I can hack'n'slash code? Well, it's true for the most
part. I'm kind of a "C Programmer". No, not the language. . . . that's the
GRADE I got in my programming class (what do you expect from a mechanical
engineer?). Seriously, though, I appreciate your help with this and if you
can tell me what I'm doing wrong (probably everything), I would appreciate it.
 
T

Tom Wickerath

Did you copy all of the functions shown on that page? If your screen is not large enough, or
your resolution is too low, you may not (? wild guess on my part) have noticed the rather lengthy
set of functions which start with:

Type tagOPENFILENAME

and end with

End Function
'************** Code End *****************


The ahtAddFilterItem function is the second to the last function included. Did you include this
function in your code?

Function ahtAddFilterItem(strFilter As String, _
strDescription As String, Optional varItem As Variant) As String
' Tack a new chunk onto the file filter.
' That is, take the old value, stick onto it the description,
' (like "Databases"), a null character, the skeleton
' (like "*.mdb;*.mda") and a final null character.

If IsMissing(varItem) Then varItem = "*.*"
ahtAddFilterItem = strFilter & _
strDescription & vbNullChar & _
varItem & vbNullChar
End Function


Tom
___________________________________


Hi Arvin,

This helped, but now I'm getting an error when I attach the code to my
button in my form. The error message I get is: "Compile error: Sub or
Function not defined" and it highlights the ahtAddFilterItem portion of my
code for the following code lines:

Private Sub Open_Save_Loc_Click()

Dim strFilter As String
Dim strInputFileName As String

strFilter = ahtAddFilterItem(strFilter, "Acrobat Files (*.PDF)", "*.PDF")
strInputFileName = ahtCommonFileOpenSave( _
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input file...", _
Flags:=ahtOFN_HIDEREADONLY)


End Sub

Remember when I said I can hack'n'slash code? Well, it's true for the most
part. I'm kind of a "C Programmer". No, not the language. . . . that's the
GRADE I got in my programming class (what do you expect from a mechanical
engineer?). Seriously, though, I appreciate your help with this and if you
can tell me what I'm doing wrong (probably everything), I would appreciate it.
 
G

Guest

Actually, that is exactly what happened. I finally caught that on the second
page he linked (Guess I should have bought "Reading for Dummies" instead of
"Programming for Dummies", heh-heh). In any case, the function works great
except for one little problem. After I select the file by double clicking
it. . . . Nothing happens. No value gets saved in the box, it just sits
there blank.
 
T

Tom Wickerath

Hello J.

I have created a sample Access 2000 database that I will send to you, if you send me a private
e-mail message with a valid return address. This will be easier than trying to explain all of
the steps in this reply.

Please indicate in the message if you need the Access 97 format, since my sample makes use of the
InStrRev function, introduced in Access 2000. I can re-write that portion of the code, if
required, to accommodate Access 97.

My temporary e-mail address is pretty easy to figure out. It should be 18 characters in length
including the @ symbol and the period in the domain name. There are no spaces in the e-mail
address. Sorry, but I don't want to post it and make it too easy for the spammers (the scum of
the Earth) to harvest the address. Whatever you do, please do not post your e-mail address in a
reply to the newsgroup.

Tom
_________________________________


Actually, that is exactly what happened. I finally caught that on the second
page he linked (Guess I should have bought "Reading for Dummies" instead of
"Programming for Dummies", heh-heh). In any case, the function works great
except for one little problem. After I select the file by double clicking
it. . . . Nothing happens. No value gets saved in the box, it just sits
there blank.
 
G

Guest

If you have solved your problem, could you share it. I am in (I think)
similar dilema. We recently upgraded to office XP professional, Above 7.0
Reader and Access 2003, before the upgrade my users were able to click on an
icon that I created for them and launch the pdf file, now the screen flicks
and that all.

Neil
 

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