|
|
Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
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
|
|
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
|
|
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 >
|
|
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..." >
|
|
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!!
|
|
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!!
|
|
|