Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Macros / February 2006

Tip: Looking for answers? Try searching our database.

deleting relationships with a macro?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
janaki - 23 Feb 2006 20:36 GMT
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
Steve Schapel - 24 Feb 2006 08:49 GMT
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?

Signature

Steve Schapel, Microsoft Access MVP

> I have a macro that will "clean up" my db after appending a bunch of records
> from some imported tables.
[quoted text clipped - 15 lines]
> thanks,
> janaki
janaki - 24 Feb 2006 15:30 GMT
i'm just manually importing using the "Get external data..." from the File
menu, and selecting "Import..."

> Janaki,
>
[quoted text clipped - 21 lines]
> > thanks,
> > janaki
Steve Schapel - 24 Feb 2006 18:29 GMT
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.

Signature

Steve Schapel, Microsoft Access MVP

> i'm just manually importing using the "Get external data..." from the File
> menu, and selecting "Import..."
janaki - 24 Feb 2006 19:50 GMT
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!!
Steve Schapel - 24 Feb 2006 20:29 GMT
Janaki,

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

Signature

Steve Schapel, Microsoft Access MVP

> 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
[quoted text clipped - 3 lines]
>
> i suppose i could try coding it, but that's a little over my head!!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.