D
Dale
This is probably really simple, but I can't figure why this error handler
runs even without an error being detected (or I can't see one in debug). If
I remark out the On Error routine, the code runs fine i.e. no errors. With
Error handling on, I get the message box pop up "No files for
import"...which means to me something triggered the error handler but all is
well..data has been imported into the temp tblPI_New_Data and the append to
the SitePI table has run.
What am I missing?
TIA...msAccess 97
Function ImportClean()
On Error GoTo ImportError
DoCmd.RunSQL "INSERT INTO SitePI ( [DATE], [SITE], [Job], [JobCount] ) " _
& "SELECT tblPI_New_Data.DATE, tblPI_New_Data.SITE, tblPI_New_Data.Job,
tblPI_New_Data.JobCount " _
& "FROM tblPI_New_Data " _
& "WHERE ((Not (tblPI_New_Data.Job) Is Null) AND (Not
(tblPI_New_Data.JobCount) Is Null));"
ImportError:
MsgBox "No files for import"
Exit Function
End Function
runs even without an error being detected (or I can't see one in debug). If
I remark out the On Error routine, the code runs fine i.e. no errors. With
Error handling on, I get the message box pop up "No files for
import"...which means to me something triggered the error handler but all is
well..data has been imported into the temp tblPI_New_Data and the append to
the SitePI table has run.
What am I missing?
TIA...msAccess 97
Function ImportClean()
On Error GoTo ImportError
DoCmd.RunSQL "INSERT INTO SitePI ( [DATE], [SITE], [Job], [JobCount] ) " _
& "SELECT tblPI_New_Data.DATE, tblPI_New_Data.SITE, tblPI_New_Data.Job,
tblPI_New_Data.JobCount " _
& "FROM tblPI_New_Data " _
& "WHERE ((Not (tblPI_New_Data.Job) Is Null) AND (Not
(tblPI_New_Data.JobCount) Is Null));"
ImportError:
MsgBox "No files for import"
Exit Function
End Function