Part of file path missing

ncords@gmail.com

New member
Local time
Today, 20:36
Joined
Oct 7, 2007
Messages
3
I have a data base created in access 2003 but I run in Access 2007 with Vista. The problem I have is when I try to open a file through access part of the file path becomes missing. For example I will open a record in a form I then have an option to view a related file as a PDF. When I click on this option it will open Adobe Reader but when it tries to find the file it cannot because part of the file path is missing. So instead of “C:\users\user\filename” it will have “:\users\user\filename” or “ser\filename” The number of characters missing varies and sometimes it works fine and goes straight to the file.
I have asked the person who created the data base but they have no idea, plus because sometimes it works and when it doesn’t the number of characters missing varies make it quite difficult to solve. Any ideas would greatly appreciated.:confused:
 
Is it *always* leading characters that are missing? Does the application have good error handling? The watch window should be able to help pin down when the value is changing.
 
Most of the time it is just the first character "C" but can be any number of the first string of characters. It is not just when opening a PDF with Adobe Reader, the same happens with some slides i have the option to view in Powerpoint. Here is the code used for opening a PDF using Adobe Reader with the files loacated in a folder called "analysis method"

Photofile = glngFilePath + "analysis method\" + Photofile
stAppName = "C:\Program Files\Adobe\Reader 8.0\Reader\AcroRd32.exe"
Call Shell(stAppName, 1)
'close dialog open box
' SendKeys "{esc}"
'open open file dialog box
SendKeys "^o"
'enter file name
SendKeys Photofile
'press enter to open file
SendKeys "{enter}"

Somtimes this works fine and goes straight to the file other times part of the file path is missing.
I did not set up this data base so don't have permissions to change any of the code. Not sure how to use the watch window.
 
SendKeys is probably your problem. It is not a reliable way to pass data between applications. You can Google around for SendKeys and you will see it is pretty much avoided by most Access developers these days.
 
Thanks for your help. Is there any other method to open a file in another application without using sendkeys?
 
...I did not set up this data base so don't have permissions to change any of the code.

...Is there any other method to open a file in another application without using sendkeys?
Without the ability to change the code I don't know if anyone here can help. I suspect you can get that file open without using SendKeys.
 

Users who are viewing this thread

Back
Top Bottom