Re: Can attributes of tables/relationships, etc. be changed programatically?



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

.



Relevant Pages

  • Re: Can attributes of tables/relationships, etc. be changed programatically?
    ... Relationships tab on Tools, then change the Required element of a few ... attributes of various controls, then copy just the structure (so that the ... of the tables empty, and make a new mdb with it. ...
    (comp.databases.ms-access)
  • Can attributes of tables/relationships, etc. be changed programatically?
    ... Relationships tab on Tools, then change the Required element of a few ... attributes of various controls, then copy just the structure (so that the ... the tables empty, and make a new mdb with it. ...
    (comp.databases.ms-access)
  • Re: 2105 "You cant go to the specified record" - but a record operation is not in process
    ... It is also possible that other code (e.g. the GotFocus or Enter event of the controls, or the Current event of the Form) could be interferring. ... Tips for Access users - http://allenbrowne.com/tips.html ... 'generic form for selecting a single or multiple lotfor further processing, printing, etc. ... I have compacted the mdb and imported the from from a backup version of the front end mdb. ...
    (microsoft.public.access.formscoding)
  • Re: Can attributes of tables/relationships, etc. be changed programatically?
    ... all the control names. ... Tips for Access users - http://allenbrowne.com/tips.html ... then change the Required element of a few ... of the tables empty, and make a new mdb with it. ...
    (comp.databases.ms-access)
  • Re: Parameter Query Form Problem
    ... Tips for Access users - http://allenbrowne.com/tips.html ... This is what I used to make my query, its was a Microsoft support site. ... controls on the form so it can run the query. ... Combo Box for searching Customer Name ...
    (microsoft.public.access.formscoding)

Loading