UNIHIVE

Study Hub UNIPORT CSC 182

CSC 182 · Computer Applications

Using Microsoft Access

Tables, field types, queries, forms and reports in a typical database package.

Our notes

2 min read

The objects of Access

ObjectJob
TableStores the data
QueryAsks questions of the data
FormA friendly screen for entering data
ReportA formatted printout

All are kept in one file (.accdb).

Creating a table

  1. Create → Table Design.
  2. Type each field name and choose its data type.
  3. Set the primary key (right-click → Primary Key).
  4. Save the table with a clear name.

Data types

TypeHoldsExample
Short TextUp to 255 charactersSurname, matric no.
Long TextLong textAddress, comments
NumberNumbers for calculationsScore
Date/TimeDatesDate of birth
CurrencyMoneySchool fees
AutoNumberCounter filled in by AccessRecord ID
Yes/NoTrue or falseFees paid?

Store a phone number as Short Text, not Number: leading zeros (0803...) would be lost, and you never add phone numbers.

Field properties

  • Field size: limit length.
  • Validation rule: for example, Between 0 And 100 for a score.
  • Required: must not be left empty.
  • Default value.

Datasheet and Design views

  • Datasheet view: rows and columns, for entering data.
  • Design view: for building the structure.

Relationships

Database Tools → Relationships: drag the matric number from Students to Results to link them (one student, many results). Tick Enforce Referential Integrity so a result cannot exist for a student who is not on the list.

Queries

Create → Query Design, add the table, choose fields, set criteria:

CriteriaFinds
"Rivers"State is Rivers
>=70Scores of 70 and above
Between 40 And 49Scores from 40 to 49
Like "O*"Names starting with O

Example: show the names and scores of students who scored below 40 in CSC 182, sorted by score. Criteria: Course = "CSC 182" and Score < 40.

A query can also calculate: Total: [Test] + [Exam].

Forms

Create → Form Wizard: choose fields and a layout. Forms make data entry easier and safer for staff who should not see the whole table.

Reports

Create → Report Wizard: choose fields, grouping (by department), sorting and totals. Print as a class list or result sheet.

Worked check

A test score of 25 and exam score of 48 give Total = 73 in the query. Check: 25 + 48 = 73. Under the 70-and-above criterion the student appears; under Between 40 And 49 they do not.

Exams usually ask

  • Name the four main objects of Access and their uses.
  • Choose suitable data types for given fields.

Common mistake

Putting everything in one big table. Split data into tables for each kind of thing and link them with keys.

Written by the UniHive team in our own words. Spotted a mistake? Tell us on WhatsApp.

Read

Watch

We link to free material and never copy it. Every link was opened by our team before it went up; video data is a rough guide at 360p.

All CSC 182 topics

Report

Sign in to report this. It is free.

Is this your work (a lecturer, author or publisher)? Ask us to take it down.