Hi all,
I want to be able to trap the existence of a table in the database once I have imported 5 text files, and then act accordingly.
I know that a particular text file (episode.txt) has 1 of 150 records with the following error in the file format:
"Previous",""ErrorFieldDoubleQuotes"","nextf" which obviously will not parse on import
and I know that when I import it, then a table [episode_ImportErrors] is created, and that 1 in 150 is listed.
Is there a way of then recognising that the table [episode_ImportErrors] has been created, and stop my code? I tried the following code, which works, but if I remove the error from the episode.txt file (and physically delete the error table) and run the code again, the code still invokes and I get the message box!!
Code:
DoCmd.SetWarnings False
If DCount("*", "episode_ImportErrors") > 0 Then
MsgBox "There is at least one fatal error in the episode.txt file structure", vbCritical, "FATAL ERROR"
Cancel = True
Exit Sub
DoCmd.SetWarnings True
End If
thanks in anticipation folks!
Pete