|
|
Many times it becomes neccessary to see if a Table object exists in your code. This simple function provides that functionality. As an FYI, in the code you will see the criteria of "[Type] In (1,4,6)". Those values break down to this: 1: Local table. CODE ' Code courtesy of UtterAccess Wiki ' http://www.utteraccess.com/wiki/index.php/Category:FunctionLibrary ' Original submission by: Brent Spaulding (datAdrenaline) ' Date contributed: 2010-07-27 ' ' You are free to use it in any application, ' provided this copyright notice is left unchanged. ' Public Function IsTable(strTableName As String) As Boolean 'Returns a Boolean indicating if the passed string is a table 'in the current database. IsTable = DCount("*", "MSysObjects", "[Name]='" & strTableName & "' And [Type] In (1,4,6)") End Function
|
| This page was last modified 09:38, 6 April 2011. This page has been accessed 2,280 times. Disclaimers |