Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 5th, 2005, 02:12 AM
Authorized User
 
Join Date: Jun 2005
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default Deleting table using Macro in Access

Hi,

I have problems creating macro to delete a table in Access. It keeps prompting me "Action Failed". Can anyone advise what is wrong?

Thanks



 
Old July 5th, 2005, 05:06 AM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 180
Thanks: 0
Thanked 0 Times in 0 Posts
Default

can you save the macro as a vba module then post the code here?

Matt

 
Old July 5th, 2005, 09:18 AM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 155
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to leehambly
Default

Put the following into a module... seems to work...
If you need it in a macro you can call the function from your macro

================================================== =======
Public Function pfunDropTable(strTableName As String)
Dim strTemp As String

strTemp = "Drop table " & strTableName
DoCmd.RunSQL (strTemp)

End Function
================================================== =======





Similar Threads
Thread Thread Starter Forum Replies Last Post
Deleting all the records in a table suthaharmca Beginning VB 6 4 January 2nd, 2008 06:14 PM
Speed up macro - deleting rows icabo Excel VBA 1 October 8th, 2007 02:18 PM
Deleting All Record In A Table McDiddy Access VBA 3 January 10th, 2007 09:20 AM
deleting a record from a linked table??? tico31pl Classic ASP Basics 0 May 18th, 2006 09:58 AM
Deleting from a table stu9820 ASP.NET 1.0 and 1.1 Basics 2 September 23rd, 2003 12:55 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.