Web Development

General discussion


PDF and Access 2000

By dennisbv ·
I have a database that is basicly a list of files in a directory. I want the user to enter in a model number(one of my fields) then click a button and a form opens with the records that match, The format of these files are pdf. I have a button on the results form that opens Adobe reader. But even when I hard code a file name it will not open, it says "file does not exist" I know it exists(if I go to the folder and click on the file it opens just fine. I need to tell Acrobat reader to open aspecific file. Below is my code for what I have
Private Sub cmdOpenGram_Click()

Dim strGram As String

strGram = "\\Mee_pdc\Home\Dennis\gram program\grams\a-a-092.pdf"

Call Shell("D:\Program Files\adobe\reader\acrord32 & strGram", vbMaximizedFocus)

End Sub

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

PDF and Access 2000

by lafutura In reply to PDF and Access 2000


I tested your code under VB6 and I received the same error (file not found). I changed my location paths from yours, but found that there was an error on the Call Shell line.

Try restructuring your calling string to:

Call Shell("d:\Program Files\adobe\reader\acrord32 " & strGram, vbMaximizedFocus)

The strGram variable was not properly delineated in the call to the acrord32.exe.

As long as the file specified in strGram is accessible (via the network), it should launch andfind the file.

Have you tested it with a local file, rather than a UNC specified path? I tried it with a file on my local drive and it opened right up. (after changing the code as I specified).

It could be that your UNC path is inaccessible -security violation? file isn't really there?

Hope that helps.


Collapse -

PDF and Access 2000

by dennisbv In reply to PDF and Access 2000

Poster rated this answer

Collapse -

PDF and Access 2000

by dennisbv In reply to PDF and Access 2000

This question was closed by the author

Related Discussions

Related Forums