Results 1 to 2 of 2
  1. #1
    frcastro is offline Novice
    Windows 7 Access 2007
    Join Date
    Jun 2010
    Posts
    13

    condition in macros

    Hi,




    I have a macro action that deletes a table . If I don't have the table it shows a error.

    How can i make a condition that only deletes the table if it exists?


    Thanks!!!

  2. #2
    maximus's Avatar
    maximus is offline Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2009
    Location
    India
    Posts
    931
    Dim strSQL as String

    strSQL = "Drop Table Filtered"
    On Error Resume Next
    CurrentDb.Execute strSQL, dbFailOnError

    Table name is Filtered.
    The Table is Deleted if its is there. If it is not there No error message is Displayed.
    Add the line highlighted in red.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Like condition for 1 column help pls!
    By stodd in forum Queries
    Replies: 1
    Last Post: 03-14-2010, 01:51 AM
  2. VBA or Macros
    By mastromb in forum Forms
    Replies: 6
    Last Post: 01-03-2010, 04:46 PM
  3. hours + condition
    By Miriam in forum Queries
    Replies: 0
    Last Post: 08-09-2009, 06:46 AM
  4. Macros
    By kfhai in forum Access
    Replies: 0
    Last Post: 04-17-2009, 08:28 AM
  5. How to use IIF condition
    By nshaikh in forum Queries
    Replies: 4
    Last Post: 09-12-2008, 01:23 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums