Access Macro Delete Wildcard

Posted on 2009-04-28
Last Modified: 2013-11-27
In using a Macro, list item "DeleteObject," is there  a way to indicate a Table Name with a Wildcard?  More specifically, I would like to delete the error tables that begin with the Prefix:

'Fail Active$'

(I attempted with 'Fail* - unsuccessfully)

The only thing that changes is the extension (number of error tables). That is, can I delete more than one table at once from a DeleteObject, using a Wildcard for the prefix.

Question by:tahirih
    LVL 92

    Accepted Solution

    Hello tahirih,

    No, but if you enumerate the TableDefs collection, you can test each Name, and if the Name matches a prefix
    delete the table...

    For Each td In CurrentDb.TableDefs
        If td.Name Like "Fail*" Then
        End If



    Author Comment

    this is a simple question, but clarification is appreciated.

    can i place this code in the Macro Design window - i.e. the actual steps of doing this...thanks.


    Author Closing Comment


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
    I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
    With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now