Re: Can attributes of tables/relationships, etc. be changed programatically?
- From: "Allen Browne" <AllenBrowne@xxxxxxxxxxxxxx>
- Date: Sat, 10 Mar 2007 11:17:57 +0900
In general, you cannot merely modify the properties in code if the relation exists. You can programmatically delete a relation, set properties,and create the relation again, but it is rarely worth the trouble since it is a one-off operation.
During the design phase, you might want to leave creating the relations until you have created the bulk of the tables. That helps avoid having to create and destroy relations constantly. (Of course, this assumes you do have a complete written specification of what the database needs to do, so that you can create all the tables and verify that every design aspect is met, and then create the relations.)
If you want an example of looping through the Relations and deleting them, see:
http://allenbrowne.com/DelRel.html
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Ron" <ronSPAMBLOCKINGwest777@xxxxxxxxxxx> wrote in message
news:_OnIh.124$Bi2.109@xxxxxxxxxxx
Hi All,
Development stage of setting up a new solution here.
I CONSTANTLY have to unhook the relationships I've built via the Relationships tab on Tools, then change the Required element of a few controls on a table from yes to no, make some other adjustments to the attributes of various controls, then copy just the structure (so that the primary key resets to 1) to another name, delete the first table, rename the new table to what it should be, import some data (from another system I'm converting from), run some queries that find duplicates, missing data, deletes some garbage, etc. I then have to redo the Required elements I need, rehook the relationships and all the other stuff I had to cancel just to get the data over. Now, don't get me wrong...I'm amazed I can even DO all of this without coding anything. But...
The terrible part is, my boss is going to eventually want to take this existing mdb and make one identical too it but with only certain of the tables populated with some data and defaults and things, leaving the rest of the tables empty (ready for new data), and make a new mdb with it. NO WAY can I allow HIM to have access to all this stuff. Talk about screwing things up...
Can I do any of this in code rather than manually through all these wizards/screens, etc? And if I can do it by code, can anyone point me towards some examples I can study?
Thanks,
ron
.
- Follow-Ups:
- References:
- Prev by Date: Re: Synchronizing tables
- Next by Date: Re: Running average for weekly Dollars
- Previous by thread: Re: Can attributes of tables/relationships, etc. be changed programatically?
- Next by thread: Re: Can attributes of tables/relationships, etc. be changed programatically?
- Index(es):
Relevant Pages
|
Loading