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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error management with Call command

Status
Not open for further replies.

Kelvin

Programmer
Apr 25, 2000
23
AU
Please Help,
When calling an external database...

Private Sub cmdFeeback_Enter()
On Error GoTo Err_cmdFeeback_Enter

Dim stAppName As String

stAppName = "c:\msaccess\msaccess C:\Feedback\Feedback.mde"
Call Shell(stAppName, 1)

Exit_cmdFeeback_Enter:
Exit Sub

Err_cmdFeeback_Enter:
MsgBox Err.Description
Resume Exit_cmdFeeback_Enter
End Sub

If the above file "C:\Feedback\Feedback.mde" does not exist then I would like to roll the error over so code operation is continued without trying to open the database. If the database is there it will open as normal.

Thanking You
Kelvin
 
You are going to want to use the DIR function to check to see if the file exists:
Code:
MyFile = Dir("C:\Feedback\Feedback.mde")
IF Length(MyFile) <> 0 THEN
stAppName = &quot;c:\msaccess\msaccess C:\Feedback\Feedback.mde&quot;
    Call Shell(stAppName, 1)
ENDIF
HTH


Terry M. Hoey
th3856@txmail.sbc.com

Ever notice that by the time that you realize that you ran a truncate script on the wrong instance, it is too late to stop it?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top