0% found this document useful (0 votes)
42 views27 pages

MS Access Lab

Uploaded by

Vanamala Mahathi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views27 pages

MS Access Lab

Uploaded by

Vanamala Mahathi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

11.

111.How to Start Microso Access


Note: We assume you have the latest Microso Access installed which comes bundled
with Microso O ice 365 package.

There are two ways to Start MS Access.

1. From Windows, ‘Start’ button.


2. From Desktop, Right Click> ‘New’ option.

Now in this Microsoft Access tutorial, let’s have a look of starting MS Access using both the
ways:

Option 1) From Windows, Start button.


Step 1) Click on the ‘Windows’ icon.
You will find the list of installed programs.

Step 2) Find Access icon.


Check and click on Access Icon.
Step 3) Check the window.
MS Access Application window will appear.
Result: This will open the MS Access windows application.

Option 2) From Desktop, ‘New’ option.


Step 1) Right Click from Desktop and Click ‘New’

Step 2) Click on ‘Microsoft Access Database Option’


Step 3) Below MS Access Application window will appear

Step 4) Press ‘Esc’

Result: This will open the MS Access windows application

How to Create a Database


12.
How to Create a Database

Before we create a Database, lets quickly understand the holistic picture of what
Database is, with particular reference to MS Access.

Let’s, start with a few real-life Microso Access databases example:


We have Bookcase where Books resides,
We have i-pods where we have a collection of music & cases are countless.
Similarly, we have MS Access Database is a kind of home for all your Tables, Queries,
Forms, Reports, etc. in MS Access which are interlinked.

Technically, Database store the data in a well-organized manner for easy access and
retrieval.

There are two ways to create Database in SQL Access:

1. Create Database from Template


2. Create a Blank Database

Let’s go into the detail of each:


13.Create Database from Template
There are many situations where we need to start with some readymade database
template for given requirements.
MS Access provides many ready to use templates for such types of databases
requirements where the data structure is already defined.
You can keep customizing the template structure further as per our requirement.
MS Access Databases example includes Contacts, Student, Time tracking, etc.

Steps to create Database from Template

Step 1) With MS Access application open, Click on File.

Result: The below window will appear. All the Database templates are displayed below.

Step 2) We can select any template by clicking on it. Click on Contact Template for further
Step 3) File name box will appear with the default file name.

Step 4) Enter the new Name.


Step 5) Click on ‘Create.’

Result: Guru99_Contact Database created and below window will appear.


Step 6) Optionally, you can click on any of the objects from left navigation pane and open
that object for further references and work.

For, E.g., Clicking on ‘Contact Detail’ form will open ‘Contact Detail’ form as displayed
below.

Create a Blank Database


)
Step 1) With MS Access application open, Click on File > New

Step 2) Click on ‘Blank Database.’

Step 3) File name box will appear with the default file name.

https://www.guru99.com/ms-access-tutorial.html 14/50
Step 4) Enter the new name.

Step 5) Click on ‘Create.’

Result: Guru Database created and below window will appear.


14. How to Create Table
The first step in this Microsoft Access tutorial to store data in the database is creating a
Table where data will reside. Post creation of the table, we can keep inserting the rows in
the table.

There are two ways to create Database in MS Access

1. Create a Table from Design View


2. Create a Table from Datasheet View

Create Table – Datasheet View


Step 1) First Click Create tab. Then from Tables group, click Table.
Step 2) System will display the default table created with ‘Table1’ name.

Step 3) To Rename Column, double click on Column Header and enter the new column
Name.

Note that the Data type of Course_ID is ‘AutoNumber.‘ Hence this is also the Unique Key
of the table.
Step 4) You can Add Column by clicking on any category from the ‘Add & Delete’ group.
Alternatively, you can also add a column by clicking on ‘Click to Add’

For Example, click on ‘Short Text’ from the ‘Add & Delete’ group.

Step 5) Column will be added with the default name as ‘Field1.’


Step 6) Click on Header and rename as ‘COURSE_NAME.’

Step 7) Press ‘Ctrl + S’ and Enter the new table name to save the table.

Step 8) You can also save new Name, Caption and Short description for any Column by
clicking on ‘Name and Caption.’ Click on it
Step 9) Dialog Box will appear. Add the following and Click on ‘OK’

‘Name’ – This is the actual name of the column.


‘Caption’ – This is the user view name of the column.
‘Description’ – This is the short description of the column name.

Result: Name, Caption, and Description now exist.

Create Table – Design View


Step 1) First Click Create tab. Then from Tables group, click Table.
Step 2) Table Dialog box appears. For each Field enter Filed Name, Data Type and
Description.

Steps 3) To Add Course_ID as Primary Key, select it and Click on ‘Primary Key.’ Course_Id
will be Preceded by KEY ICON as shown below:

Steps 4) Press ‘Ctrl+S.’ Enter the Table Name and Click OK


Result:

How to Switch views between Datasheet and Design


Now in this MS Access tutorial, we will learn how to switch views between Datasheet and
Design:

To switch views, between the datasheet (spreadsheet view) and the design view, click the
‘View’ button in the top-left hand corner of the Access Ribbon (shown in the
Home/Help/Design Tabs). And Click on the View you need to display.

For Example: Let’s Assume You want to switch to the newly created table
‘Course_strength’ from ‘Design view’ to ‘Data Sheet’ View.

Step 1) Click on Datasheet View


Result:

MS Access- Adding Data

You have created tables Course and Course_Strength.


There are two ways to add data. One is Datasheet view and other from Form. We will
learn to add data from Datasheet view in this section.
There is no need to save the data manually. Once you click other rows, Access
automatically saves the data.
The only thing you need to take care while adding data is, you should enter the
correct data type, i.e., if Column is defined as Number we can add only number and
not text.

Let’s add some data in your table by opening the Access database you have created
earlier.

Step 1) Select the ‘Course’ table


Step ) Select t e Cou se table

Steps 2) Select the Datasheet view option in the ribbon and add some data by entering
the values in It. Updated Data will be Autosaved.

Now let’s say You want to delete 4th row with ‘My SQL’ as Course name.

Step 3) Select the row by clicking on the leftmost column and Right Click on the row. The
options menu will appear with the ‘Delete Record’ Option
Step 4) Popup Window will appear to confirm the deletion of the record. Click ‘OK’

Result:
Summarizing views:
Datasheet View:

Displays in the view, which allows you to enter raw data into your database table.

Design view:

Displays the view, which allows you to enter fields, data types, and descriptions into your
database table.

15. Forms in MS Access

A form is a database object that you can use to create a user interface for a database
application.
It mainly used to ease the process of data entry or editing.
Data in a form can be selected from one or more tables.
Forms can also be used to control access to data, like which fields or rows of data are
visible to which users.
Forms have a Form View.
Help you to display live data with easy creation of new data.

To understand form lets first create two new Record in Contact Table (from the prebuilt
Contact Database discussed here)

Step 1) Select the ‘Contact’ table from Left Navigation.

Step 2) Create two rows by entering some relevant data in two rows.
create Form, and then we will see how forms can be leverage for easy display, editing,
and creation of new data.

How to Create a form


There are four primary ways to create the form as mentioned below:

Form Wizard
Form
Multiple Item
Split Form

Let’s have a look at each option to create the form, one by one:

1. Create using Form Wizard


This option allows the user to create the form with the wizard and select the column from
the available list of column form in legacy Select window format.

Step 1) Click on ‘Form Wizard.’


Step 2) System will display below the screen.

Step 3) Select the columns which you want to be there in final form.

Result: ID is selected
Step 4) Keep selecting all required column as explained in Step 3 above and then click
‘Next.’

Step 5) Layout selection box will appear which allows the user to select the different type
of form layout. Click ‘NEXT’
Step 6) Enter the name of the form as “Contact_Form” and click ‘Finish.’
Result: Contact_Form now exist with all column displayed which are there in step 4 in the
Selected column list.

You might also like