'******************** Code Start ************************
'This code was originally written by Dev Ashish.
'It is not to be altered or distributed,
'except as part of an application.
'You are free to use it in any application,
'provided the copyright notice is left unchanged.
'
Function fExistTable(strTableName As String) As Boolean
Dim db As Database
Dim i As Integer
Set db = DBEngine.Workspaces(0).Databases(0)
fExistTable = False
For i = 0 To db.TableDefs.Count - 1
If strTableName = db.TableDefs(i).Name Then
'Table Exists
fExistTable = True
Exit For
End If
Next i
Set db = Nothing
End Function
...The web is a wonderful thing....
Arry said:
In VBA i need to run code to check to see if a table exists. If it does i am appending records to the table from my VBA sql, but if it doesn't i need to create the table. I have created the code to append or create new but i cannot find out how to "check" to see if the table exists.
There must be a simple coding line to do this!!!
All help appricated.