Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Apr 2005
    Location
    Plovdiv
    Posts
    109
    Thanks
    0
    Thanked 0 Times in 0 Posts

    delete all records ? (Access 2000)

    which is the right syntax to delete all the records in a table? I receive the
    message that i have a syntax error:
    Dim Bas As String
    Bas = " delete * tblVegs"
    CurrentDb.Execute Bas

  2. #2
    4 Star Lounger
    Join Date
    Jan 2002
    Location
    Brookings, South Dakota, USA
    Posts
    449
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: delete all records ? (Access 2000)

    Use:

    Bas = "Delete * From tblVegs"


    Hope this helps.

    gdr
    <IMG SRC=http://www.wopr.com/w3tuserpics/gdrezek_sig.jpg>
    "Those who dance are considered insane by those who can't hear the music" - George Carlin

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: delete all records ? (Access 2000)

    Gary has already answered your question.

    In general, when you need SQL in VBA code, it is a good idea to create a query in design mode, test that it does what you want, and then select View | SQL to see the SQL for the query. You will know that the SQL is valid. You only need to convert the SQL to a string, removing the line breaks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •