Lonnie, the answer you gave me worked great!!! Thanks so much. I'll post it below for others to benefit from. The only thing people should keep in mind is that if you are using a front-end, back-end application, this code must be written to the back-end. Here's the code:
Public Function RunOutSideQry()
Dim app As Access.Application
Set app = CreateObject("Access.Application"
app.OpenCurrentDatabase ("c:\test.mdb"
'check to see if the table exist
Dim tbl As TableDef
For Each tbl In app.CurrentDb.TableDefs
If tbl.Name = "MyTable" Then
app.DoCmd.DeleteObject acTable, tbl.Name
Exit For
End If
Next tbl
app.CurrentDb.Execute ("MyQuery"
End Function
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.