UtterAccess HomeUtterAccess Wiki

Welcome Guest ( Log In | Register )

Custom Search
Edit Discussion
> Tableexists    

'Example usage: If TableExists("tblMyTable") Then
'Will also find System and Hidden tables

'   Code courtesy of UtterAccess Wiki
'   http://www.utteraccess.com/wiki/index.php/Category:FunctionLibrary
'   on 7 October 2010
'   You are free to use it in any application,
'   provided this copyright notice is left unchanged.

Public Function TableExists(strTableName As String) As Boolean
  Dim accTable As AccessObject
   TableExists = False 'Default Value remains False if Table is not found
   ' Use the CurrentData.AllTables Collection to get all Tables
   ' Loop through the list of Tables to get the names
   For Each accTable In CurrentData.AllTables
       If strTableName = accTable.Name Then
           TableExists = True  ' We found the table
           Exit For ' Exit the Loop
       End If
   Next accTable

End Function

-- 20:35, 7 October 2010 (EDT)

Creative Commons License
Tableexists by UtterAccess Wiki is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Editing and revision of the content is freely encouraged; for details, see Expected Usage.

Edit Discussion
Custom Search

Thank you for your support!
This page has been accessed 6,952 times.  This page was last modified 00:00, 9 May 2013 by Mark Davis. Contributions by Jack Leach, Alan Greenwood and Hunter57  Disclaimers