By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,154 Members | 2,313 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,154 IT Pros & Developers. It's quick & easy.

Make ImportError Tables go away

Nathan H
100+
P: 104
Is there a way to make it so Access does not create an import errors table if there are problems? I am handling import errors via another method, but these tables being auto generated are causing headaches, especially after several months they begin to stack up.

Thanks in advance
Dec 7 '07 #1
Share this Question
Share on Google+
6 Replies


Jim Doherty
Expert 100+
P: 897
Is there a way to make it so Access does not create an import errors table if there are problems? I am handling import errors via another method, but these tables being auto generated are causing headaches, especially after several months they begin to stack up.

Thanks in advance
Hi Nathan,

You might want to consider looping through the table defs on opening of the database or some other 'relevant' point to determine if any exist and if so delete them. You can base the the logic for that on the table name having 'ImportErrors' contained in the name of the table to take into account the incremental naming nature of access for successive import errors.

Expand|Select|Wrap|Line Numbers
  1.  
  2. Function DeleteImportErrors()
  3. Dim DB As DAO.Database
  4. Dim T As DAO.TableDef
  5. Dim TName As String
  6. Dim I As Integer
  7. Set DB = CurrentDb()
  8. For I = 0 To DB.TableDefs.Count - 1
  9.      Set T = DB.TableDefs(I)
  10.      TName = T.Name
  11.      If InStr(TName, "ImportErrors") > 0 Then
  12.      DoCmd.DeleteObject acTable, TName
  13.      End If
  14. Next I
  15. End Function
  16.  
Regards

Jim :)
Dec 7 '07 #2

Nathan H
100+
P: 104
Awesome! Thanks Jim...worked like a dream. I put it on the splash screen as on on open event so it will start fresh each session.

Thanks again!
Dec 7 '07 #3

Jim Doherty
Expert 100+
P: 897
Awesome! Thanks Jim...worked like a dream. I put it on the splash screen as on on open event so it will start fresh each session.

Thanks again!
You're welcome

Jim :)
Dec 7 '07 #4

ADezii
Expert 5K+
P: 8,669
Is there a way to make it so Access does not create an import errors table if there are problems? I am handling import errors via another method, but these tables being auto generated are causing headaches, especially after several months they begin to stack up.

Thanks in advance
Expand|Select|Wrap|Line Numbers
  1. Dim tdf As DAO.TableDef
  2.  
  3. For Each tdf In CurrentDb.TableDefs
  4.   If InStr(tdf.Name, "ImportErrors") > 0 Then
  5.     CurrentDb.TableDefs.Delete tdf.Name
  6.   End If
  7. Next
Dec 7 '07 #5

ADezii
Expert 5K+
P: 8,669
Hi Nathan,

You might want to consider looping through the table defs on opening of the database or some other 'relevant' point to determine if any exist and if so delete them. You can base the the logic for that on the table name having 'ImportErrors' contained in the name of the table to take into account the incremental naming nature of access for successive import errors.

Expand|Select|Wrap|Line Numbers
  1.  
  2. Function DeleteImportErrors()
  3. Dim DB As DAO.Database
  4. Dim T As DAO.TableDef
  5. Dim TName As String
  6. Dim I As Integer
  7. Set DB = CurrentDb()
  8. For I = 0 To DB.TableDefs.Count - 1
  9.      Set T = DB.TableDefs(I)
  10.      TName = T.Name
  11.      If InStr(TName, "ImportErrors") > 0 Then
  12.      DoCmd.DeleteObject acTable, TName
  13.      End If
  14. Next I
  15. End Function
  16.  
Regards

Jim :)
Hello Jim, not trying to step on your toes, but just offering an alternative approach.
Dec 7 '07 #6

Jim Doherty
Expert 100+
P: 897
Hello Jim, not trying to step on your toes, but just offering an alternative approach.
Feel free Dez.....

For i believe that For each loop
.....there is a way lol :))
Neeeeext!!

Jim :)
Dec 8 '07 #7

Post your reply

Sign in to post your reply or Sign up for a free account.