Acc97: Use button on a form to run a FoxPro .exe

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)

Exit_exeCreateCustInvenDBF_Click:
    Exit Sub

Err_exeCreateCustInvenDBF_Click:
    MsgBox Err.Description
    Resume Exit_exeCreateCustInvenDBF_Click
   
End Sub


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.
Tim DeatonFreelance BookkeeperAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Jokra_the_BarbarianConnect With a Mentor Commented:
The Universal Naming Convention is what the mapped drive letter is mapped to. Here's some more info:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wnet/wnet/universal_name_info_str.asp

1. In Windows Explorer, choose "Tools/Map Network Drive" from the menu.
2. Choose Drive "F".
3. Copy what's in displayed in the Folder: combo box.
4. Replace "F:\FOXPROW\NEWFOX25\EXECUTE\PRODNIPR.EXE " with what you copied.

 
0
 
Jokra_the_BarbarianCommented:
Where does the database reside, on a workstation or a file server? Try replacing the path with a UNC path. That way, you don't have to rely upon a mapped drive ("F:").
0
 
Tim DeatonFreelance BookkeeperAuthor Commented:
1. I don't know what a "UNC path" is.
2. Everything resides on the file server.  The part of it where my Access files live is mapped as the "W" drive, and the part where the Foxpro files live is mapped as the "F" drive.
0
 
Tim DeatonFreelance BookkeeperAuthor Commented:
It worked!  Thanks.
0
 
Jokra_the_BarbarianCommented:
You're welcome. Always use a UNC whenever possible since you can't guarantee that every workstation or server has the same mapped drives. -Jokra
0
All Courses

From novice to tech pro — start learning today.