delete a table

  • Thread starter -00Eric Clapton
  • Start date
0

-00Eric Clapton

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

Graham R Seach

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
 
Top