Questions about Access relationships - Microsoft Community


hi - new access not sql.  have created set of normalized tables test foray wonderful world of ms access.  here picture of tables , relationships have created.i know may little overkill contact database i'm trying learn how access works.  want able create form adds contact , allow addition of contact address(s), phone(s), relations(s), date(s), , url(s).  same idea company eventually.  

let's take task of adding 2 addresses contact example.   have normalized address data "address" table , use "rel_contactaddress" , "rel_companyaddress" create relationships.   think need use contact form "address" sub-form, how access create "rel_contactaddress" table entry @ same time creates "address" table entry?  may on complicating specific contact-to-address relationship, can see need in future work able define these types of relationships.  can in other sql database engines.  can see, access has allowed me create relationships.  question how form designed allow user add new contact 2 addresses (home, , 2nd home defined in "addresstype" lookup field) , create "rel_contactaddress" entries @ same time?  bonus question - if "addresstype" other allow user add address type label of own in "otherval".  help.  if not correct forumto ask question of type, please point me in right direction.


within main contacts form include subform based on query joins rel_contactaddress , address tables.  query should return columns former, , latter values wish show in subform.  controls in subform combo box bound foreign addressid column, set hide bound column , show address data address.  address data can concatenated single second column in control's rowsource query string expression.

controls in subform bound columns address table should have enabled property set false (no), , locked property true (yes) make them read only.

add new address can include button in subform opens form bound address table in dialogue mode @ empty new record.  in button's code include line after opens address form requeries combo box add new address list.

regards otherval column, should include code in beforeupdate event procedure of text box control bound column pops message box , sets return value of cancel argument true if value in addresstype control not 'other'.


Office / Access / Microsoft Office Programming / Office 2016



Comments

Popular posts from this blog

Getting ErrorCode: 120018 when trying to access Microsoft account - Microsoft Community

The message was sent to a distribution list ‎(DL)‎ - Microsoft Community

Activation Error 0x8004FE93 - Microsoft Community