Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Next part of the tutorial, we will be creating databases with 2 separate tables.

This is handy if you have multiple data for


one entity. Example, 1 person can have multiple contact numbers. By using multiple tables, we can add as many contact
numbers to that person.

Database name: Projects

Table #1 (Make sure you’re in Design view for this)


Table Name: Project
Field Name Data Type Description Field size
proj_no number Project ID Long integer
proj_name Text Project name 50
d_started Date/Time Date the project started
d_ended Date/time Date the project ended

Set the proj_no as the primary key, to check if its already the primary key, at the left side of the field name try to look if
there’s a key icon. If it is present, then you are set to go.

Feel free to add more fields that you think your database need.

To create a new table, go to CREATE, then click TABLE.

Table #2 (Make sure you’re in Design view for this)


Table Name: Drawing
Field Name Data Type Description Field size
proj_no Number Project ID Long integer
rev_no Autonumber Project revision number Long integer
rev_d Date/Time Revision date of the drawing
d_file Attachment Attached files

The proj_no should be the same as the proj_no as above, we will use this to link the tables together. The rev_no on the
second table should also be the primary key for this table.
Now, we will create a relationship between the tables. This means, 1 project can have several drawing revisions. We will
create a 1 is to many relationship.

To create the relationship, click DATABASE TOOLS, and click RELATIONSHIPS. It will open a show table dialog box. Select
both tables and click add.

Note: Please close all other tabs, the only tab that should be open is the relationships tab before creating the
relationship.

Click edit relationships.

It will open the edit relationship dialog box.

Click Create New. In the Left Table Name, click the drop down arrow and choose Project. In the Right Table Name,
choose Drawing. Select proj_no for both column names.

Click OK.
Check Enforce Referential Integrity, then click the other two check box.

And Click CREATE.

Now you can enter your data. Next step, we will create a form that will combine the 2 tables. And consolidate your fields
Now we have our multiple tables, we will create a form that will be easier for us to enter and browse data. The easiest
way to do this is to close all tabs, except for the project tab. Placed it on datasheet view, click CREATE, then click FORM.

The Upper part of the form is the Project table, and the lower part of the form is the drawings table. Every time you
want to update or add a new drawing click NEW on the lower part.

Click here if you want to add a new drawing

If you want to add a new project, use these buttons on the lowest part of the form to navigate to the records.

Customize your form.


Larger view of the records

NOTE: saw an error, please change rev_no datatype from autonumber to number. That will fix the default increment.

You might also like