Sei sulla pagina 1di 3

The British University In Egypt - BUE

Faculty of Business Administration, Economics & Political Science


Business Administration Department

14BMIS01C
Business Information Systems

Access Tips
When you create a Database in Access, it is preferable to create the following items with the order as follows:
1.
2.
3.
4.
5.
6.
7.

Tables using Design View: Table for each Entity that includes the needed Attributes or Fields.
Relationships between Tables (Database Tools).
Data Entry in each Table (using Datasheet View).
Queries using Design View.
Reports using Wizard.
Forms using Wizard: Form for each Table and Query, with Buttons in each Form using Design View.
Main Menu Form with required Buttons using Design View.

N.B.: Layout View is used for some purposes as mentioned later.


1. Tables
Attribute Data Type: If an attribute that its data type could be Short Text or Number, such as: D-ID, P-no,
Dept-Code, Salary, etc, to decide:
If you need to do mathematical operations on this attribute, such as: +, -, *, /, etc, the data type of this
attribute must be Number (or Currency), e.g. Salary.
But, if you dont need to do mathematical operations on this attribute, the data type could either be Short
Text or Number, e.g. Dept-Code. However, it is more logic to use Short Text data type.
On the other hand, in the D-ID and P-no attributes, in order to avoid system ignoring of the zero on the left
hand side in some values, the data type of these attributes must be Short Text.

2. Relationships
(1 M) Relation
Copy the Primary Key (PK) of Table of 1 to Table of M. The copy of PK is called the Foreign Key (FK).
(M M) Relation
Create a new table (Bridge Table) to break (MM) relation into two (1 M). This new table contains 3 attributes:
a copy of each PK of the 2 tables that have (M-M) relation (i.e. 2 FK), and
any new attribute as a PK (for this new table) with Autonumber as its data type.
N.B.: Both the PK and FK must have both the same data types and the same values in Data Entry.
Dont use Auto-number data type for a PK attribute, to avoid problems when creating the relationships.
Do the following steps, after creating the Relationships in Access, to generate a Report for the
Relationship and also to save it as a PDF file:
Database Tools Relationships Relationship Report Page Setup: Portrait, PDF.

3. Data Entry
Some attributes in different Tables may contain the same values due to the relationship between
these tables. For example, the Specialization attribute in Doctor Table, and Complaint attribute in Patient
Table, and Dept-Name in Department Table; all these 3 attributes contain the same values that are: Eye,
Children, Bone, and Brain.
In case of (1 M) relation, you must start entering data in Table of 1 and after filling all its records,
you can then start entering data in Table of M. For example, you must enter all needed data in
Department Table (1 Table) first and then Doctor Table (M Table), as relation between Department
Doctor is (1 M).
N.B.: In Datasheet View, you can click on the + sign at the left hand side of each record; to view the related
record(s) in the other table (that has a relationship with that table).

Dr. Ali Fakhri

Page 1 of 3

The British University In Egypt - BUE


Faculty of Business Administration, Economics & Political Science
Business Administration Department

14BMIS01C
Business Information Systems

4. Queries
A Query is used to select specific records according to a certain given criteria, from one or more Tables.
Query is simply a small table with some data included from the original Table(s).

5. Reports
A Report could be generated from 1 or more: Tables or Queries. A Report includes some attributes of
the original Table(s) or Query(s). A Report is used to group data according to a certain attribute(s).
A Report may use functions such as: sum, count, etc. using Layout View Design Totals.

6. Forms
Make a Form for each Table and Query.
A Form should include all the attributes of the original Table or Query.
For each Form, do the following steps:
For example, the Doctor Form of Doctor Table,

Open Doctor Form, View Design View,


- Design Controls: Button,
Record Navigation, Go to Next Record Picture, Go to Next Finish.
- Design Controls: Button,
Record Navigation, Go to Previous Record Picture, Go to Previous Finish.
- Design Controls: Button,
Record Operations, Add New Record Picture, Pencil (Edit) Finish.
- Design Controls: Button,
Record Operations, Delete Record Picture, Delete Record Finish.
- Design Controls: Button,
Form Operations, Close Form Picture, Stop Finish.
View Form View (to try buttons added).
For each Table Form created (i.e. Doctor, Patient, Department, Manager, Doctor-Patient) do the
following steps:
For example, the Doctor Form of Doctor Table,

Open Doctor Form, View Design View,


- Design add Logo: suitable picture, Title: Form, Date and Time.
- Highlight all text edit from Home.
View Layout View,
- Select Form background change its colour from Home.
- Home know how to use: Sort (Ascending or Descending), and Find to search for a specific field
within a record.

7. Main Menu Form


Create Blank Form,
View Design View,
Right-click Fill/Black Colour: choose Form background colour.
Design Controls: choose Aa, write: Tables; choose Aa, write: Queries; choose Aa, write: Reports.
Design add Logo: suitable picture, Title: Main Menu.
Highlight all text edit from Home.

Dr. Ali Fakhri

Page 2 of 3

The British University In Egypt - BUE


Faculty of Business Administration, Economics & Political Science
Business Administration Department

14BMIS01C
Business Information Systems

Design Controls: Button,


Form Operations, Open Form Doctor Open the form and show all records Text, write:
Doctor Finish.
N.B.: You must repeat this step for each item created in your database (i.e. all Forms, and all
Queries, and all Reports and Relationship Report), to add buttons for each item in Main Menu.
Design Controls: Button,
Application, Quit Application Picture, Stop Finish.

View Form View (to try buttons added).


Close Main Menu Form and name it as Main Menu.
File Options Current Database Display Form: Main Menu Ok.
N.B.: You can also see the Main Menu Form on Youtube. Open Youtube, and then write in it: "Creating a Main
Menu Form and Buttons in an Access Database". You will find several videos, e.g.:
http://www.youtube.com/watch?v=bqs8LIgKZTA
N.B.: You can right-click on each Table, and Query, and Report Export Word.

N.B.: You could refer to the solved database example Hospital Complete Access file (taken in the Lab
Exercises) uploaded on the e-learning for more details.

Extra Point (Optional) Relationships


(1 1) Relation
Copy the Primary Key (PK) of any of the 2 Tables and put it in the other Table. The copy of PK is called
the Foreign Key (FK).
Adjust the properties of the FK as follows:
Right click on Table that has FK, View Design View,
Stand with mouse on FK attribute, go to General at bottom part of Design View Required: Yes,
Indexed: Yes (No Duplicates).
Close Table Database Tools, Relationships: connect the 2 Tables.
View Datasheet View,
Insert data into the new attribute added (i.e. FK).
N.B.: You should make a new Form for the Table to include the new attribute added.

Dr. Ali Fakhri

Page 3 of 3

Potrebbero piacerti anche