Need cancel error 3709

bhelmy

Registered User.
Local time
Today, 16:25
Joined
Dec 6, 2015
Messages
62
if file was import didnt find in pass show error 3709 i wan to cancel this error


the code

DoCmd.RunSavedImportExport "Trade file"
DoCmd.OpenQuery " Run Trade File "
 
Hi bhelmy

Just add error trapping to your procedure and check the err number. Something like..

Code:
On Error Goto SubError

DoCmd.RunSavedImportExport "Trade file"
DoCmd.OpenQuery " Run Trade File "

SubExit:
Exit sub

SubError:

If Err.Number = 3709 then
Msgbox "File does not exist"
Goto SubExit
End If

Msgbox Err.Number & vbLF & Err.Description
Goto SubExit
 

Users who are viewing this thread

Back
Top Bottom