Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

form button links to pdf 1

Status
Not open for further replies.

wrmedia

Technical User
Jun 6, 2002
19
US
I want to put a button on a form that will open a pdf file in acrobat

the tricky part is I want this button to find a pdf file that has the same file name (file number eg 1234.pdf) as the auto number of the current record the user is at

if auto number is say 43008 you will click a button on this record and it will open a pdf with the corresponding file name 43008.pdf in a linked directory

can it be done?
 
Try adding the following coding to your button's OnClick event:

Shell ("""C:\Program Files\Adobe\Acrobat 5.0\Acrobat\Acrobat.exe"" C:\pathname\" & Me.AutoNum & ".PDF")

The first part of the Shell parameter tells where the Acrobat program resides. The next part is the path leading to the directory of PDF files. The third part is the AutoNum value from the current form and the ending attaches the PDF extension to it.
 
thanks worked perfectly - very impressive

need to take it one step further where if the vendor_id on the form happens to be LSI it will instead go to a different directory path and open a PDF that matches the field order_id

cheers
 
Do the same type of thing:

If Me.vendor_id = "LSI" Then
Shell ("""C:\Program Files\Adobe\Acrobat 5.0\Acrobat\Acrobat.exe"" C:\otherpathname\" & Me.order_id & ".PDF")
Else
Shell ("""C:\Program Files\Adobe\Acrobat 5.0\Acrobat\Acrobat.exe"" C:\pathname\" & Me.AutoNum & ".PDF")
End If



[shadeshappy] Cruising the Information Superhighway
[sub] (your mileage may vary)[/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top