Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with function

Status
Not open for further replies.

rry2k

Programmer
Jun 28, 2001
678
US
I have a function that I'm trying to run but I need help resolving a space in the path. I probably don't want to rename the file if I don't have to. The function works fine without the space.
Public Function OpenOtherMDB()
On Error GoTo Err_Handler

Dim stAppName As String

stAppName = "C:\Program Files\Microsoft Office\Office\msaccess.exe
O:\WorkOrders.[Work Order New.mdb]&quot; <--- space Here
Call Shell(stAppName, 1)
DoCmd.Quit
Exit_ErrHandler:
Exit Function

Err_Handler:
MsgBox Err.Description
Resume Exit_ErrHandler

End Function

Thanks..Russ
 
Thanks. I checked out the link but it still doesn't tell me how to resolve the space.
 
Just enclose it in quotes. It will work.
Code:
retval = ShellExecute(Application.hWndAccessApp, &quot;open&quot;, &quot;C:\Program Files\Microsoft Office\Office\MSAccess.exe&quot;, &quot;O:\WorkOrders\Work Order New.mdb&quot;, &quot;C:\Program Files\Microsoft Office\Office&quot;, SW_MAXIMIZE)
 
Cool thanks, I appreciate the help.

Russ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top