You are on page 1of 6

MS-ACCESS NOTES GRADE 10 Database A database is an organized collection of data.

The advantage of using a database is that storage and retrieval of data is easier and faster. A database management system is a program that lets you create, organize and manage data stored in a database. Access uses data from multiple tables instead of requiring you to duplicate data in two or more places hence it is a relational database(RDBMSRelational Database Management System). MS- Access file has the extension accdb (older versions have mdb). A table is a collection of data about a specific topic arranged in records and fields. A record is a row in a table and is collection of related fields. A field is a column in a table. Access stores the related database tables in a single file. A database file may contain the following objects or components: a. b. c. d. e. f. Tables Queries (a selection of data retrieved from one or more tables. E.g. Cross tab query) Report ( a printed table output) Macro ( a list of task you want Access to perform) Modules ( programs in VBA language) Form ( onscreen data entry sheet)

ACCESS OPENING SCREEN When you open MS- Access you can start with a blank database. This requires you to set up the entire database structure including tables and fields. You can also open an existing database.

Creating a database 1|Page MS-ACCESS NOTES- MS. MARIAMMA T DANI

a. When you start Access select Blank database. Type in the file name and click create. b. You will see the screen as shown below:

c. Click on Table1 and select the Design View Icon. d. Save the table. e. You will see the screen as shown below:

f.

Type in the field names in the upper half of the Design View (called the field grid pane). A field name can be upto 64 characters long including spaces. A field name should start with a character or number and should not contain. (Full stop), [] (opening and closing square brackets) and ! g. Press Tab and click the Data Types drop down list to select the fields data type. For example number, text etc. h. Press tab and type a description for easy identification (not compulsory) 2|Page MS-ACCESS NOTES- MS. MARIAMMA T DANI

i.

The lower half of the Design View (Field property pane) contains the settings for the field properties.

DATA TYPES: a. TEXT Text data consists of letters, numbers or combination of both. Numbers that dont require calculations like phone numbers. It can have upto 255 characters. b. MEMO Lengthy text or combination of text and numbers. It can have up to 63, 999 characters. c. NUMBER Numeric data to be used in calculations. Field Size property can be used to set up the specific number type. d. DATE/TIME - Date and time values. Many formats can be used. e. CURRENCY - Currency values and numeric data used in mathematical calculations involving data with one to four decimal places. f. AUTONUMBER - A unique sequential (incremented by 1) number or random number assigned by Microsoft Access whenever a new record is added to a table. g. YES/NO - Yes and No values and fields that contain only one of two values (Yes/No, True/False, or On/Off). Also called Boolean Values. h. OLE object - An object (such as a Microsoft Excel spreadsheet, a Microsoft Word document, graphics, sounds) to be linked or embedded. i. HYPERLINK - Text or combinations of text and numbers stored as text and used as a hyperlink address. j. LOOK UP WIZARD- Creates a field that allows you to choose a value from another table or from a list of values by using a list box or combo box. PRIMARY KEY FIELD Primary Key field uniquely identifies records in a table. It does not contain any null or duplicate values. It helps to find records quickly. To make a field a primary key a. Select the field in the Design View, right click and select primary key

b. Select the field in the design View and click on the Primary key icon. You can also remove the primary key using the above methods. CANDIDATE KEY All the fields that are capable of becoming primary keys are called Candidate keys. ALTERNATE KEY The Candidate keys not chosen as Primary key are called Alternate key

Setting the Field Properties The lower half of the Design View contains settings for the field properties: 1. FIELD SIZE: You can use the Field Size property to set the maximum size for data stored in a field set to the Text, Number, or AutoNumber data type. You can limit the characters in a field. If the Data Type property is set to Text, enter a number from 0 to 255. 3|Page MS-ACCESS NOTES- MS. MARIAMMA T DANI

2.

3. 4.

5. 6.

7.

If the Data Type property is set to AutoNumber, the Field Size property can be set to Long Integer or Replication ID. If the Data Type property is set to Number, the Field Size property settings can be Byte, Decimal, Integer, Long Integer, Single or Double FORMAT: it decides how data will be displayed in the datasheet view. It displays a drop down list with predefined formats. Custom formats can also be done. For example predefined formats for Date/ Time are General date, Long Date, Medium Date, Short Date, Long Time, Medium Time, and Short Time. For Number the predefined Values are general, currency, euro, fixed, standard, percent and scientific. For text if data has to be displayed in uppercase, > sign has to be used in Format and if it has to be displayed in lowercase < sign has to be used in Format. For currency to be displayed in Ds, Ds #.## has to be entered in Format. CAPTION To change the field heading in the Datasheet View. DEFAULT VALUE The Default value which is set appears when a new record is created in the table. The user can enter a value that is different from the default value. For example if you want the current date to be displayed as default, you can enter =now() in the default property box. REQUIRED- this property holds Yes or No to determine whether a value is needed in the field or not. If you dont want a user leaving a field blank,enter yes for the required property. ALLOW ZERO LENGTH You can use the zero length property to specify whether a zero length string is a valid entry in the field in the datasheet view. This applies to text, memo and hyperlink fields. If set to yes, Zero length string is a valid entry. A zero length string is (2 double quotes without blank space). VALIDATION RULE Access automatically validates data based on the fields data type. More specific settings can be done by using the validation rule. A validation rule is an expression that limits the values that can be entered in a field in the data sheet view. The rule can have a maximum of 2048 characters. For complex expressions the expression builder can be used. Validation Text property Entry must be a nonzero value. Entry must be blank or greater than 1000. Entry must be 5 characters and begin with the letter "A". Entry must be a date in 1996. Entry must be greater than zero Entry must be either zero or over 100 Entry must be either US, UK or Canada

Validation Rule property <> 0 > 1000 Or Is Null Like "A????" >= #1/1/96# And <#1/1/97# >0 0 or > 100 US OR UK OR CANADA

8. VALIDATION TEXT The error message that is displayed when user violates the validation rule. The Validation Text can have a maximum of 255 characters. 9. INPUT MASK sets a pattern for data entry so that data entry is easier. Not applicable to autonumber, memo, OLE, hyperlink and Yes/ No data types VIEWS IN A TABLE

4|Page

MS-ACCESS NOTES- MS. MARIAMMA T DANI

1. Design View:

2. Datasheet View: This view in which the data is entered. The table is displayed in a worksheet like format. Until a data is entered, the datasheet view shows only one empty record. In the Datasheet View if the field Name is cut short then drag the field separator to the left or right to increase or decrease the field width. The Datasheet View allows you to enter, view and edit data in the records. Each time a record is entered, a blank record appears below. To enter current date quickly in a field, press Ctrl +: and to enter current time quickly in a field, press Ctrl +: Right Clicking on the field headings will give options as Sort ascending, Sort Descending, Copy, Field Width, Hide, Unhide, Freeze, Unfreeze all fields, Find, Insert Field, Rename and Delete. Right clicking on the record selector gives options New Record, Delete Record, Cut, Copy You can change the font color, font size, gridlines, and background color in the datasheet view. FIELD NAME

RECORD

FREEZING AND UNFREEZING COLUMNS IN DATASHEET VIEW You can freeze columns so that they become the leftmost column in the datasheet view and are visible at all times no matter where you scroll. Right click on any column in the datasheet view and select freeze columns. To unfreeze, right click and select Unfreeze all columns. HIDING AND UNHIDING COLUMNS IN DATASHEET VIEW You can hide and Unhide specified columns. When a field is hidden it is no longer visible in the Datasheet View. Right click the particular field and select the option Hide Column. REPLACING DATA Right click in the Datasheet View and select Find. Type the word to be found and type the word you want to replace it with in the Replace Box. Click Replace. SORTING DATA Data can be sorted in ascending and descending order in the Datasheet View. RENAMING A FIELD

5|Page

MS-ACCESS NOTES- MS. MARIAMMA T DANI

A field can be renamed in both the views. In the Design View just delete the old name and type in the new field name. In the Datasheet View right click on the field heading and select Rename and type in the new name. MODIFYING TABLE STRUCTURE In a table fields can be added and deleted in the Datasheet view as well as Design View. In the Design View if a field has to be added in the end of the table then just click the mouse at the empty Field Name column and add the Field name and give the data type. If a field has to inserted between 2 fields then select the lower field, right click and select Insert Rows. An empty row will be inserted above the selected field. Give the field name and Data Type. If a field is to be deleted in the Design View select the field and right click and select Delete Rows. The added and deleted fields in the Design View will automatically be shown in the Datasheet View also. In the Datasheet View if a field is to be added then right click on the column before which you wish to place the field and select Insert Columns. A new field will be inserted before the one selected. By default the new field will have the name Field1 and text as the default data type. The field can be renamed by right clicking on the field and selecting Rename option. The Data Type can be changed only in the Design View. To delete a field in the Datasheet View, right click on the field and select Delete columns option. To delete a record: in the datasheet right click on the record to be deleted by clicking on the record selector and select the option Delete Record To insert a record: in the datasheet right click on the record selector and select the option New Record

6|Page

MS-ACCESS NOTES- MS. MARIAMMA T DANI

You might also like