A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

delete a table



 
 
Thread Tools Display Modes
  #1  
Old September 1st, 2005, 08:06 AM
-00Eric Clapton
external usenet poster
 
Posts: n/a
Default delete a table

How can I delete a table and the criteria is based on the value of another
table using query? Thanks.


  #2  
Old September 1st, 2005, 11:45 AM
Graham R Seach
external usenet poster
 
Posts: n/a
Default

Public Function DeleteTable(ID As Long) As Boolean
Dim tdf As TableDef
Dim sTableName As String

On Error GoTo Proc_Exit

sTableName = DLookup("[TableName]", "tblTableNames", "[ID] = " & ID)

CurrentDb.TableDefs.Delete sTableName
CurrentDb.TableDefs.Refresh

DeleteTable = True

Proc_Exit:
End Function

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------

" -00Eric Clapton" wrote in message
...
How can I delete a table and the criteria is based on the value of another
table using query? Thanks.



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to delete records that match any field in another table ? Will General Discussion 2 September 15th, 2005 10:54 PM
Help with relationship plase Rock Database Design 5 July 4th, 2005 03:54 AM
Access combo box-show name, not ID, in table? write on New Users 30 April 30th, 2005 09:11 PM
Seeking some expert advice. HD87glide Using Forms 14 March 23rd, 2005 10:11 PM
Automatically Delete Duplicated Data in Table faxylady Running & Setting Up Queries 3 September 29th, 2004 06:58 PM


All times are GMT +1. The time now is 03:40 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.