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!

link auto number to pdf sub directory

Status
Not open for further replies.

wrmedia

Technical User
Jun 6, 2002
19
US
need an update to an old problem that was solved =

"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"

code looks like this for on-click

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

the linked directory is now becoming too large and I'd like to split into sub directories

if 43008 is chosen how would I get it to look in sub directory 4 of the linked directory for it - in other words the first digit of the auto number would correspond to a sub directory

thanx
 
How about...

Shell("""C"\Program Files\Adobe\Acrobat 5.0\Acrobat\Acrobat.exe"" C"\pathname\" & Left(Me.AutoNum,1) & "\" & Right(Me.AutoNum,Len(Me.AutoNum)-1) & ".pdf")


Randy
 
Have you tried this ?
Shell ("""C:\Program Files\Adobe\Acrobat 5.0\Acrobat\Acrobat.exe"" C:\pathname\" & Left(Me.AutoNum, 1) & Mid(Me.AutoNum, 2) & ".PDF")

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top