A procedure is calling a function to see if a table is empty through a Boolean value, however, i am receiving a compiler error. any assistance, would be appreciated.
the code is:
the code is:
Code:
If TableExists = False Then
DoCmd.DeleteObject acTable, "ContractImport"
DoCmd.DeleteObject acTable, "ContractImport$_ImportErrors"
End If
Code:
Public Function TableExists(strTable As String) As Boolean
Dim strName As String
On Error Resume Next
'If table exists already then strName will be > ""
strName = CurrentDb.TableDefs(strTable).Name
TableExists = Not (strName = "")
End Function
Comment