PC Review


Reply
Thread Tools Rate Thread

delete mutiple objects at once

 
 
Dave
Guest
Posts: n/a
 
      24th May 2004
Hi all,
Our '97 back end db has temp tables created in it, all
prefixed with the letters AA. Is there a way to delete
them all in one hit instead of manually deleting each?
There is another sequence of tables prefixed with ZZ, so
this procedure will save me time each time it needs to be
repeated.
Thanks in advance,
Dave
 
Reply With Quote
 
 
 
 
Allen Browne
Guest
Posts: n/a
 
      24th May 2004
Quickest way will probably be to hold down the Shift key while deleting them
from the Database window. (This avoids the confirmation dialog.)

If you want to do it programmatically, you could loop backwards through the
TableDefs collection, deleting those with a matching Name.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Dave" <(E-Mail Removed)> wrote in message
news:1111001c4414c$5f40aad0$(E-Mail Removed)...
>
> Our '97 back end db has temp tables created in it, all
> prefixed with the letters AA. Is there a way to delete
> them all in one hit instead of manually deleting each?
> There is another sequence of tables prefixed with ZZ, so
> this procedure will save me time each time it needs to be
> repeated.
> Thanks in advance,
> Dave



 
Reply With Quote
 
solex
Guest
Posts: n/a
 
      24th May 2004
Unfortunately, you will need to delete and confirm each and every deletion
access does not allow you to make multiple selections in the database
window. Otherwise you can do as Allen suggested and write some code to
delete the tables.

Regards,
Dan

"Dave" <(E-Mail Removed)> wrote in message
news:1111001c4414c$5f40aad0$(E-Mail Removed)...
> Hi all,
> Our '97 back end db has temp tables created in it, all
> prefixed with the letters AA. Is there a way to delete
> them all in one hit instead of manually deleting each?
> There is another sequence of tables prefixed with ZZ, so
> this procedure will save me time each time it needs to be
> repeated.
> Thanks in advance,
> Dave



 
Reply With Quote
 
Chris Nebinger
Guest
Posts: n/a
 
      24th May 2004
Using DAO:

Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("Select Name from
msysobjects where type = 1 and left(name,2)='aa'")
Dim rows() As String
Dim intCounter As Integer
ReDim rows(0)
Do Until rst.EOF
ReDim Preserve rows(UBound(rows) + 1)
rows(UBound(rows)) = rst("Name")
rst.MoveNext
Loop
For intCounter = 1 To UBound(rows)
DoCmd.DeleteObject acTable, rows(intCounter)
Next


There is no error handling, or object clean up in that
code, but it will work.


Chris Nebinger
>-----Original Message-----
>Hi all,
>Our '97 back end db has temp tables created in it, all
>prefixed with the letters AA. Is there a way to delete
>them all in one hit instead of manually deleting each?
>There is another sequence of tables prefixed with ZZ, so
>this procedure will save me time each time it needs to be
>repeated.
>Thanks in advance,
>Dave
>.
>

 
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: Button to delete records in mutiple tables Dirk Goldgar Microsoft Access 3 3rd Sep 2009 05:40 PM
How do you edit or delete objects in Insert Objects box in Word? =?Utf-8?B?Qm9iIFQ=?= Microsoft Word Document Management 1 6th Nov 2007 02:46 PM
How do I move mutiple objects from one Access project to another? Uncle Boo Microsoft Access Getting Started 1 31st Aug 2006 09:29 PM
RE: Mutiple page delete macro's =?Utf-8?B?RlN0MQ==?= Microsoft Excel Setup 0 3rd Aug 2005 08:01 PM
Delete mutiple rows in a dataGrid using delete Key =?Utf-8?B?TVZC?= Microsoft Dot NET Framework 0 26th Oct 2004 05:39 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:24 PM.