Determine what tables are in a database window with Access 2000

D

Del

In my application the user enters a table name in a text box on a form. I
want to use code to verify that the table entered is actually in the database
window. How can I do this?
 
D

Douglas J. Steele

Function TableExists(NameOfTable As String) As Boolean
' Returns True if table exists, False otherwise
On Error Resume Next

TableExists = (CurrentDb.TableDefs(NameOfTable).Name = NameOfTable)

End Function
 
Top