No, if you use DeleteObject, it will delete from currentdb (or possibly
codedb if you're running the code from an add-in). If you want to delete a
table or a query, Arvin's suggestion will work...
Set db = OpenDatabase("path to database")
db.TableDefs.Delete "some table"
db.QueryDefs.Delete "some query"
HOWEVER, if you're trying to delete a form or any other object other than
tables or queries, you would need to instantiate another Application object
and use automation, i.e.,
Set app = New Access.Application
app.OpenCurrentDatabase "path to database here"
app.Docmd.DeleteObject [objType], [objName]
app.Quit
--
Paul Overway
Logico Solutions
http://www.logico-solutions.com
Mota said:
Ok,then how to delete a table from inside this db.Can i use
DoCmd.DeleteObject and be sure that tables in db will be deleted,rather
than
a table with the same name in currentDB?
Thank you for ur help.