Determine what tables are in a database window with Access 2000

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top