Group:  Microsoft Access ยป microsoft.public.access.macros
Thread: deleting relationships with a macro?

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

deleting relationships with a macro?
janaki 23.02.2006 20:36:33
I have a macro that will "clean up" my db after appending a bunch of records
from some imported tables.

after getting all the records appended, i want to delete the imported tables.

i've written the macro with "deleteObject" for each of the tables, but when
i run it, i get the error that it can't do it because the tables are linked
by relationships. none of the imported tables are linked to any of the
tables that i want to keep - they're only linked to each other (i.e. all the
linked tables will be deleted). i know that i could import them without the
links, but since i'm having other users do this, i would prefer to not worry
about them skipping the step to not import relationships when they do the
import step.

i hope i've laid the problem out clearly.

any help greatly appreciated!
thanks,
janaki
Re: deleting relationships with a macro?
Steve Schapel <schapel[ at ]mvps.org.ns> 24.02.2006 08:49:45
Janaki,

You didn't mention how you are going about the import of the tables, or
where they are coming from. Presumably you are using a TransferText or
TransferDatabase action in your macro?

--
Steve Schapel, Microsoft Access MVP


janaki wrote:
[Quoted Text]
> I have a macro that will "clean up" my db after appending a bunch of records
> from some imported tables.
>
> after getting all the records appended, i want to delete the imported tables.
>
> i've written the macro with "deleteObject" for each of the tables, but when
> i run it, i get the error that it can't do it because the tables are linked
> by relationships. none of the imported tables are linked to any of the
> tables that i want to keep - they're only linked to each other (i.e. all the
> linked tables will be deleted). i know that i could import them without the
> links, but since i'm having other users do this, i would prefer to not worry
> about them skipping the step to not import relationships when they do the
> import step.
>
> i hope i've laid the problem out clearly.
>
> any help greatly appreciated!
> thanks,
> janaki
Re: deleting relationships with a macro?
janaki 24.02.2006 15:30:27
i'm just manually importing using the "Get external data..." from the File
menu, and selecting "Import..."


"Steve Schapel" wrote:

[Quoted Text]
> Janaki,
>
> You didn't mention how you are going about the import of the tables, or
> where they are coming from. Presumably you are using a TransferText or
> TransferDatabase action in your macro?
>
> --
> Steve Schapel, Microsoft Access MVP
>
>
> janaki wrote:
> > I have a macro that will "clean up" my db after appending a bunch of records
> > from some imported tables.
> >
> > after getting all the records appended, i want to delete the imported tables.
> >
> > i've written the macro with "deleteObject" for each of the tables, but when
> > i run it, i get the error that it can't do it because the tables are linked
> > by relationships. none of the imported tables are linked to any of the
> > tables that i want to keep - they're only linked to each other (i.e. all the
> > linked tables will be deleted). i know that i could import them without the
> > links, but since i'm having other users do this, i would prefer to not worry
> > about them skipping the step to not import relationships when they do the
> > import step.
> >
> > i hope i've laid the problem out clearly.
> >
> > any help greatly appreciated!
> > thanks,
> > janaki
>
Re: deleting relationships with a macro?
Steve Schapel <schapel[ at ]mvps.org.ns> 24.02.2006 18:29:54
Janaki,

Any reason for not using a macro for the import? If you're going to all
the trouble to import manually, why don't you delete the tables manually
afterwards too? Is it feasible to do the manual import of the tables
one by one, rather than all of them in the same step - I think then the
Relationships would not be included.

--
Steve Schapel, Microsoft Access MVP


janaki wrote:
[Quoted Text]
> i'm just manually importing using the "Get external data..." from the File
> menu, and selecting "Import..."
>
Re: deleting relationships with a macro?
janaki 24.02.2006 19:50:27
well, i thought about that, but how do i do that?? i can put "RunCommand" in
a macro line, and select "Import", but all that does is trigger the import
function, and i still have to instruct my users to select the correct tables,
and to deselect the relationships checkbox (which, of course, fixes the end
problem).

i suppose i could try coding it, but that's a little over my head!!
Re: deleting relationships with a macro?
Steve Schapel <schapel[ at ]mvps.org.ns> 24.02.2006 20:29:33
Janaki,

Depends where the imported tables are coming from. Probably the
TransferDatabase action in your macro will be applicable.

--
Steve Schapel, Microsoft Access MVP


janaki wrote:
[Quoted Text]
> well, i thought about that, but how do i do that?? i can put "RunCommand" in
> a macro line, and select "Import", but all that does is trigger the import
> function, and i still have to instruct my users to select the correct tables,
> and to deselect the relationships checkbox (which, of course, fixes the end
> problem).
>
> i suppose i could try coding it, but that's a little over my head!!

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net