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

    Call Shell(stAppName, 1)

    Exit Sub

    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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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:").
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.
The Universal Naming Convention is what the mapped drive letter is mapped to. Here's some more info:

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.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Tim DeatonFreelance BookkeeperAuthor Commented:
It worked!  Thanks.
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.