G
Guest
Hi
I'm a newbie to Access, but have a respectable amount of experience in Excel
VBA.
I have set up a 'DeleteObject' macro in Access to delete the main data table
as a precursor to importing the most up-to-date version of the same data into
a table with the same name as the deleted table via TransferSpreadsheet
macro. This was all hunky dory until I put in another 2 tables, joined
one-to-many to the main table. Now, when I try to run the DeleteObject query
I get the error message: 'You can't delete the table 'IssuesImport'; it is
participating in one or more relationships. If you want to delete this
table, first delete its relationships in the Relationships window'
Which is fine, but I don't want to have to delete and reinstate these joins
every time I import fresh data. I have looked in the 'Action' options within
Macros, and there doesn't seem to be a suitable 'Relationships' macro. So
I'm thinking VBA, but I can't get a handle on the Access object model, or
info from VBA Help re. the correct method and its arguments. I am thinking
this should be straight-forward, but...
As a 'starter for ten', I identified the Alter Table statement, and the
acCmdCreateRelationship and acCmdDiagramDeleteRelationship, but frustratingly
haven't the foggiest how to make these work!
Any help would be deeply appreciated (you all seem a friendly (and
knowledgeable)lot from looking at the activity in the Community here).
Thanks in advance
Paul
I'm a newbie to Access, but have a respectable amount of experience in Excel
VBA.
I have set up a 'DeleteObject' macro in Access to delete the main data table
as a precursor to importing the most up-to-date version of the same data into
a table with the same name as the deleted table via TransferSpreadsheet
macro. This was all hunky dory until I put in another 2 tables, joined
one-to-many to the main table. Now, when I try to run the DeleteObject query
I get the error message: 'You can't delete the table 'IssuesImport'; it is
participating in one or more relationships. If you want to delete this
table, first delete its relationships in the Relationships window'
Which is fine, but I don't want to have to delete and reinstate these joins
every time I import fresh data. I have looked in the 'Action' options within
Macros, and there doesn't seem to be a suitable 'Relationships' macro. So
I'm thinking VBA, but I can't get a handle on the Access object model, or
info from VBA Help re. the correct method and its arguments. I am thinking
this should be straight-forward, but...
As a 'starter for ten', I identified the Alter Table statement, and the
acCmdCreateRelationship and acCmdDiagramDeleteRelationship, but frustratingly
haven't the foggiest how to make these work!
Any help would be deeply appreciated (you all seem a friendly (and
knowledgeable)lot from looking at the activity in the Community here).
Thanks in advance
Paul