By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,934 Members | 1,352 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,934 IT Pros & Developers. It's quick & easy.

deleting an object in another database

P: n/a
Hi Folk

I am trying to delete an object in another database, but from reading the
google newsgroup archives, it seems that this is not possible. Does anyone
know any easy work-arounds? Can you use the docmd.copy thing and override
the old one?

Cheers

- Nicolaas
Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Br
windandwaves <wi*********@coldmail.com> wrote:
Hi Folk

I am trying to delete an object in another database, but from reading
the google newsgroup archives, it seems that this is not possible.
Does anyone know any easy work-arounds? Can you use the docmd.copy
thing and override the old one?

Cheers

- Nicolaas


You can certainly reference an external database and there should be no
reason you can't delete an object from it.

Something like..

Dim myDB as Datbase
Set myDB = OpenDatabase("c:\MySecondDB.mdb")
myDB.TableDefs("tblDeleteMe").Delete

(look up the help for syntax etc.. I'm "making it up" as I type :)

--
regards,

Bradley

A Christian Response
http://www.pastornet.net.au/response
Nov 13 '05 #2

P: n/a
Br@dley wrote:
windandwaves <wi*********@coldmail.com> wrote:
Hi Folk

I am trying to delete an object in another database, but from reading
the google newsgroup archives, it seems that this is not possible.
Does anyone know any easy work-arounds? Can you use the docmd.copy
thing and override the old one?

Cheers

- Nicolaas


You can certainly reference an external database and there should be
no reason you can't delete an object from it.

Something like..

Dim myDB as Datbase
Set myDB = OpenDatabase("c:\MySecondDB.mdb")
myDB.TableDefs("tblDeleteMe").Delete

(look up the help for syntax etc.. I'm "making it up" as I type :)


Hi Bradly

That works for tabledefs and querydefs, but I need to delete modules and
forms..... and I do not think that this works.
Nov 13 '05 #3

P: n/a
Dim objAcc As Access.Application
Set objAcc = GetObject("C:\myOldDB.mdb")
objAcc..DoCmd.DeleteObject acForm, "frmBad"
objAcc.Application.Quit
Set objAcc = Nothing

Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.