Microsoft Access
  Home arrow Microsoft Access arrow Page 5 - Getting to Know Access 2003, Part 3
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Mobile Linux 
App Generation ROI 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
MICROSOFT ACCESS

Getting to Know Access 2003, Part 3
By: Sage Adams
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 12
    2004-12-22

    Table of Contents:
  • Getting to Know Access 2003, Part 3
  • Creating a New Table Without the Wizard
  • Set the Properties for Your Field
  • The Primary Key
  • Relationships

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Getting to Know Access 2003, Part 3 - Relationships


    (Page 5 of 5 )

    Relating your tables is important because it speeds up routine information retrieval and reduces errors in data entry. Moreover, it is useful because related tables can be used to add corresponding subforms and subreports (more on those in a later lesson). Finally, relationships between tables help enforce data integrity.

    It’s best to define relationships between your tables when you first create the tables – before you have any data entered. However, you can define relationships at any time.

    To create a relationship between two tables you just need to tell Access which fields they have in common. Generally, in the oft-used one-to-many relationship the parent table has a primary key that relates to a foreign key in another table. A foreign key is essentially a field with values that match those in the other table’s primary key but are not necessarily unique.

    If you used the Table Wizard to create your tables you might already have relationships created, but either way you can see by choosing the Tools | Relationships menu option. If no relationships are currently defined you’ll be shown the list of tables and queries dialog box from which you can choose the objects you want to relate. Once you have done so your tables or queries are placed in the Relationships window. The primary key of each object is bolded. You’ll see some new toolbar button options at the top of the window too, such as Show Table and Show All Relationships; explore these new buttons. The Relationships page looks similar to the following from the Northwind Sample Database:

    Getting to Know Access 2003 Part 3

    You can draw a relationship line by selecting and dragging a field name (usually the primary key) from one table or query to an identical field name in another table or query (usually a foreign key).

    You set referential integrity by right-clicking a relationship line and checking the Enforce Referential Integrity checkbox in the dialog box that opens. Once you set referential integrity you also have the option of checking "Cascade Update Related Fields" and "Cascade Delete Related Records." The first option lets you make changes to the primary key in the parent table; Access will then automatically update the child tables to reflect the change. The second option lets you delete parent records; Access will then automatically delete the child records when you delete their parents. The dialog box to set referential integrity looks like the following:

    Getting to Know Access 2003 Part 3


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

     

    MICROSOFT ACCESS ARTICLES

    - Linking SQL Express 2005 Tables to MS Access...
    - Working with Access Projects in Access 2007
    - Exploring Access 2007
    - Working with Stored Procedures in an MS Acce...
    - Creating and Using Action Queries
    - Creating Data Access Pages with Charts using...
    - Advanced Ideas using VBA
    - VBA Details
    - Updating Records in MS Access
    - Using ADO`s Record Object with URLs
    - Exporting XML from MS Access 2003
    - Importing XML into MS Access 2003
    - On Using Pass-through Queries in MS Access
    - Distributed Queries in MS Access
    - Configuring a Linked Microsoft Access Server...





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
    Stay green...Green IT