Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Schenectady, New York, USA
    Posts
    273
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Deleting a Table in VBA (Access 2000)

    <img src=/S/help.gif border=0 alt=help width=23 height=15> Good day all. I have a table that I create in another database. The table can change from year to year depending on a management decisions. I generate the table dynamically as folloows:

    strSQL = "Create Table .........."
    Set db = OpenDatabase("J:BSmemberItemDBBudgetBill_ItemsBill _Item_TablesNYSBudgetItems_Be.mdb")
    db.Execute strSQL

    My problem is that I can't figure out how to delete the old table first. Can anyone tell me how I could use a DELETE Table format? <img src=/S/brickwall.gif border=0 alt=brickwall width=25 height=15>

    Thank you
    Don
    <img src=/S/flags/USA.gif border=0 alt=USA width=30 height=18> <img src=/S/flags/NewYork.gif border=0 alt=NewYork width=30 height=18> "Life on Earth is expensive, but at least it includes a free trip around the Sun."

  2. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Deleting a Table in VBA (Access 2000)

    I believe you could use the DROP Table command.

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Deleting a Table in VBA (Access 2000)

    db.TableDefs.Delete "tablename"
    Charlotte

  4. #4
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Schenectady, New York, USA
    Posts
    273
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Deleting a Table in VBA (Access 2000)

    Charlotte,
    <img src=/S/yep.gif border=0 alt=yep width=15 height=15> Exactly what I needed. <img src=/S/thankyou.gif border=0 alt=thankyou width=40 height=15> <img src=/S/thankyou.gif border=0 alt=thankyou width=40 height=15> <img src=/S/thankyou.gif border=0 alt=thankyou width=40 height=15>
    Don
    <img src=/S/flags/USA.gif border=0 alt=USA width=30 height=18> <img src=/S/flags/NewYork.gif border=0 alt=NewYork width=30 height=18> "Life on Earth is expensive, but at least it includes a free trip around the Sun."

  5. #5
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Schenectady, New York, USA
    Posts
    273
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Deleting a Table in VBA (Access 2000)

    Pat,

    Thank you for your help.

    Don
    Don
    <img src=/S/flags/USA.gif border=0 alt=USA width=30 height=18> <img src=/S/flags/NewYork.gif border=0 alt=NewYork width=30 height=18> "Life on Earth is expensive, but at least it includes a free trip around the Sun."

Posting Permissions

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