|
Forum home »
Delegate support and help forum »
Microsoft Access Training and help » Realationships
Realationships
The UK's most regular instructor-led training courses.
Training information: access+courses+in+london
· Microsoft.access.courses
· Microsoft Access Training uk See also
· microsoft access training
· access vba courses
· access database course Resolved · Low Priority · Version 2003
Realationships
by - delegate Emma [1 post] (2008 Aug 14 Thu, 16:54) Reply
How do you relate tables?
RE: realationships
Hi Emma, Thank you for the post and welcome to the forum;
A relationship works by matching data in key fields - usually a field with the same name in both tables. In most cases, these matching fields are the primary key from one table, which provides a unique identifier for each record, and a foreign key in the other table. For example, teachers can be associated with the students they're responsible for by creating a relationship between the teacher's table and the student's table using the TeacherID fields.
Having met the criteria above, follow these steps for creating relationships between tables.
1. In the database window view, at the top, click on Tools>Relationships
2. Select the Tables you want to link together, by clicking on them and selecting the Add Button
3. Drag the primary key of the Parent table (Teacher in this case), and drop it into the same field in the Child table (Student in this case.)
4. Select Enforce Referential Integrity
When the Cascade Update Related Fields check box is set, changing a primary key value in the primary table automatically updates the matching value in all related records.
When the Cascade Delete Related Records check box is set, deleting a record in the primary table deletes any related records in the related table
5. Click Create and Save the Relationship
I hope that has helped, if so please click the resolved link, regards Pete
Related articles
· How To Find Good Access Database Courses In London
· Why consider Access Visual Basic training?
· Access VBA Handling Errors and Debugging Code
· Tips for designing databases in Microsoft Access
· Microsoft Access Mistakes to Avoid
Please browse our web site to find out more about
access+courses+in+london and other Microsoft training courses. | Access tip:
Display current date & time in column of any width
The worksheet function =NOW() returns the current date & time. When entered into a column which is not wide enough to display the value NOW returns, the cell displays ###’s.
You could widen the column to make the date and time show, but sometimes this is not convenient: the column may already be exactly the width you want to accommodate all entries in cells further below. Maybe you don’t want to push any other columns any further to the right, because you won’t be able to see the column contents on one screen, or because it forces you to change the print settings.
The solution is to use the TEXT function to convert the value returned by NOW to text: text (as opposed to a value) stretches into the next column rather than returning ###’s. The TEXT function has two arguments: 1. the value to convert to text; 2. what format to show it in. Use custom number codes in double quote marks to specify the format. For example =TEXT(NOW(),”ddd dd/mm/yy hh:mm”) will return date and time using the format FRI 09/04/04 11:24.
View all Access hints and tips |
|