Error files

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am importing Excel files to access. In this process Acces creats error
files. Is there a way we can stop this from happening. I am using VBA code to
import the excel files. I do not need those error files.

Thanks.
 
There's no way to prevent them that I'm aware of, but you could always
delete them if you don't need them.
 
This a a database that i build for automating and the users use this several
times a day and every time they import, it creats this error table.

So i am deleting this maually everyday. Is there a way i can delete them
automatically!!!

Thanks
 
Sure. Off the top of my head, I don't remember the exact name of the table
that gets generated, but I believe it's <name of table being imported
into>_Errors or something like that.

You could loop through the TableDefs collection and delete any table that
ends with _Errors:

Dim dbCurr As DAO.Database
Dim intLoop As Integer

Set dbCurr = CurrentDb()
For intLoop = (dbCurr.TableDefs.Count - 1) To 0 Step -1
If Right(dbCurr.TableDefs(intLoop), 7) = "_Errors" Then
dbCurr.TableDefs.Delete dbCurr.TableDefs(intLoop).Name
End If
Next intLoop
 
thanks a lot. I will try this out. But in the mean time, could you please
explain me what is a DAO. I have never used this and sounds interesting.
Thanks
 
I am trying this code in VBA and i am gettting this erro

"data type mismatch"

Please help!!!!!
 
Back
Top