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 IamaSherpa 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
 
This really won't help your problem directly, but as a general rule of thumb, avoid using spaces in naming conventions. Use an underscore if you really want the space there. VB sometimes has problems with spaces in unexpected places. You should be aware that the rumor is that Microsoft is going to exclude some of the macros from future versions of Access so it will be even more important to comform to VB as much as you can.

- PETE
 
Thanks Pete. I took over this app from someone else and I agree, I never uses spaces. What macros did you hear that are going to be discontinued?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top