does a table exsist????

jordan0904

Registered User.
Local time
Today, 22:03
Joined
Jul 19, 2000
Messages
13
o.k. heres one.. i created 5 tables (create tabledef....) any way I need to append all table together later. the problem there may be some times that a table has no info so never gets created. How do i check if a table exsists?
 
Try to catch the exception - i.e. use error-handling like this:

Dim rs as Recordset
On Error Goto Err_
Set rs=currentDB.OpenRecordset("TableName",dbOpenTable)

Exit_:
Set rs=nothing
Exit sub

Err_:
MsgBox "Table not found"
Resume Exit_
 
The following code searches for a table, and if found deletes. It could be used simply determine if a table exists.

With dbs
For Each tbld In .TableDefs
If tbld.Name = "tblTempFound" Then
.TableDefs.Delete ("tblTempFound")
End If
Next tbld
End With
 

Users who are viewing this thread

Back
Top Bottom