Connecting Tech Pros Worldwide Forums | Help | Site Map

deleting an object in another database

windandwaves
Guest
 
Posts: n/a
#1: Nov 13 '05
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



Br@dley
Guest
 
Posts: n/a
#2: Nov 13 '05

re: deleting an object in another database


windandwaves <winandwaves@coldmail.com> wrote:[color=blue]
> 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[/color]

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


windandwaves
Guest
 
Posts: n/a
#3: Nov 13 '05

re: deleting an object in another database


Br@dley wrote:[color=blue]
> windandwaves <winandwaves@coldmail.com> wrote:[color=green]
>> 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[/color]
>
> 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 :)[/color]

Hi Bradly

That works for tabledefs and querydefs, but I need to delete modules and
forms..... and I do not think that this works.


Chuck Grimsby
Guest
 
Posts: n/a
#4: Nov 13 '05

re: deleting an object in another database


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

Closed Thread