PC Review


Reply
Thread Tools Rate Thread

Can you automatically delete import error tables using a macro?

 
 
Troy21
Guest
Posts: n/a
 
      14th May 2010
I have several databases that import data and create error tables due to null
values, etc..... I can't change the source data or the database table field
formats to prevent these tables from being created, so I want to
"automatically" delete these error tables wiwthout human intervention. Any
ideas?
 
Reply With Quote
 
 
 
 
Jerry Whittle
Guest
Posts: n/a
 
      14th May 2010
Modified a little from: http://support.microsoft.com/?kbid=210307

Function DeleteImportErrorTables()
Dim db As DAO.Database, t As DAO.TableDef, i As Integer
Set db = CurrentDb()
For i = db.TableDefs.Count - 1 To 0 Step -1
Set t = db.TableDefs(i)
If t.Name Like "*ImportErrors" Then
db.TableDefs.Delete t.Name
End If
Next i
db.Close
End Function

Put something like the above on the Timer event in your opening form.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"Troy21" wrote:

> I have several databases that import data and create error tables due to null
> values, etc..... I can't change the source data or the database table field
> formats to prevent these tables from being created, so I want to
> "automatically" delete these error tables wiwthout human intervention. Any
> ideas?

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Import excel file automatically that results in 2 tables Ken Snell Microsoft Access External Data 0 4th Mar 2010 01:26 AM
Automatically import tables into Excel using ODBC Sheldon Microsoft Excel Programming 0 27th Aug 2008 04:21 PM
Macro to import tables ...Please help =?Utf-8?B?dHphcF8xOTk4?= Microsoft Access Macros 1 9th Aug 2006 04:28 PM
After Import: Could Not Delete From Specified Tables =?Utf-8?B?cm1jb21wdXRl?= Microsoft Access External Data 0 22nd Apr 2006 03:09 PM
Better Way to Delete Import Error Tables? =?Utf-8?B?QmlsbCBTdHVyZGV2YW50?= Microsoft Access Form Coding 2 1st Feb 2005 07:45 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:18 AM.