I'm trying to use the code below. But when the code is run I get:
Compile error: an infotype defined by user is not defined. <dbClient As
Databaseis then highlighted.
Somebody an idea on how do I make this work?
Thanks,
john
Private Sub CheckExists(strTableName As String)
' check to see if the table exists, if it does then delete it since the next
step
' in the process is to run a MakeTable query
Dim dbClient As Database
Dim tdf As TableDef
Set dbClient = CurrentDb
For Each tdf In dbClient.TableDefs
If tdf.Name = strTableName Then
DoCmd.DeleteObject acTable, trTableName
Exit Sub
End If
Next
End Sub
The method is called by:
Private Sub CheckExists("MyTable")