Acc97: Use button on a form to run a FoxPro .exe
Posted on 2004-10-26
I'm using a form with buttons as a menu in Access97. I want to create a button on that menu that runs an .exe file created by our FoxPro programmer. If I run the .exe from a WindowsXP shortcut icon, it runs fine. But when I try it from my Access button, it starts running, then fails with the message "invalid path or filename".
Here's the code:
Private Sub exeCreateCustInvenDBF_Click()
On Error GoTo Err_exeCreateCustInvenDBF_Click
Dim stAppName As String
stAppName = "F:\FOXPROW\NEWFOX25\EXECUTE\PRODNIPR.EXE -t"
Call Shell(stAppName, 1)
I'm assuming that the difference is that when I create a Windows shortcut there is a "Start In" blank for entering the path to the files used by the program you're running. But I don't know how to do the same thing in Access.
Thanks for your help.