Resume Next instructs the program to resume at the next line AFTER the one that caused the error, which in your case is "Exit Sub". Try the following:
Code:
Private Sub Command17_Click()
On Error Resume Next
DoCmd.DeleteObject acTable, "ImportErrors"
On Error GoTo ErrorHandler
DoCmd.TransferText acImportFixed, "Import Specification", "Table", "C:\file.txt"
DoCmd.Close acForm, "Form", acSaveYes
DoCmd.OpenForm "Form"
DoCmd.OpenTable "ImportErrors"
Exit Sub
ErrorHandler:
MsgBox ("There was a problem importing the file. Check the filename and try again.")
Resume Next
End Sub