Access 2003
Hi All,
I have the following code in a module:
I would like to run it from a macro (RunCode).
I have tried, but I keep getting errors e.g. "The expression you entered has a function name that Microsoft Office can't find."
Am a novice, thanks for all the help.
Michael
Hi All,
I have the following code in a module:
Code:
Function TableExist(Name As String) As Boolean
Dim objTable As TableDef
On Error Resume Next
Set objTable = CurrentDb.TableDefs(Name)
TableExist = Not objTable Is Nothing
Exit Function
End Function
Sub Test()
Dim strName As String
strName = "Customers"
If TableExist(strName) Then
MsgBox "Table " & strName & " Exists", vbInformation
Else
MsgBox "Table " & strName & " Does Not Exist", vbExclamation
End If
End Sub
I would like to run it from a macro (RunCode).
I have tried, but I keep getting errors e.g. "The expression you entered has a function name that Microsoft Office can't find."
Am a novice, thanks for all the help.
Michael