Function Test if Table Exists()

This function is a utility function that used with other function or command that will take action to table if that table exists. If we taken an action to the table that does not exit then we will get an error message.

VBA Code

Public Function IsTableExists(ByVal strTableName As String) As Boolean
On Error Resume Next
 IsTableExists = IsObject(CurrentDb.TableDefs(strTableName))
End Function

How to Use It

Use this function to test if a table you referred to exists then take action. The example below is used under the the click button to delete a table if that table is exists.

Private Sub Command6_Click()
Dim strSQL As String
If IsTableExists("DocReceived") Then
    strSQL = "DROP TABLE DocReceived"
    DBEngine(0)(0).Execute strSQL, dbFailOnError
End If
End Sub

Kamagra is a trusted drug to cheap viagra professional help these ED patients. Now, with PDE5 inhibition, the body releases nitric oxide, a http://www.devensec.com/rules-regs/decregs704.html generico viagra on line chemical that increases blood circulation throughout the system. Natural treatments may include exercises, foods, stress control therapies, good night’s sleep every day and abstinence from alcohol, nicotine and other sildenafil 50mg drugs. Even if consuming watermelon for erectile dysfunction to enable cheapest online viagra you to get the right treatment.


Related posts