Microsoft Access Tutorial
Microsoft Access Tutorial
6.8M
What is Manual Testing
Next
Stay
Database File:
It is a file which stores the entire database. The database file is saved to
your hard drive or other storage devices.
Datatypes:
Datatypes are the properties of each field. Every field has one datatype like
text, number, date, etc.
Table
A Table is an object which stores data in Row & Column format to
store data.
A Table is usually related to other tables in the database file.
Each column must have Unique name
We can also define Primary Key in a table.
Query
Queries answer a question by selecting and sorting and filtering data
based on search criteria.
Queries show a selection of data based on criteria (limitations) you
provide.
Queries can pull from one or more related Tables and other Queries.
Types of Query can be SELECT, INSERT, UPDATE, DELETE.
Form
A form is a database object that you can use to create a user
interface for a database application.
Forms help you to display live data from the table. It mainly used to
ease the process of data entry or editing.
Report
A report is an object in desktop databases primarily used for
formatting, calculating, printing, and summarizing selected data.
You can even customize the report's look and feel.
Macros
Macros are mini computer programming constructs. They allow you to set
up commands and processes in your forms, like, searching, moving to
another record, or running a formula.
Modules:
Modules are procedures(functions) which you can write using Visual Basic
for Applications (VBA).
Short Text Text, including numbers which does not need calculation. (e.g., Up to 255 characters.
Mobile numbers).
Long Text This data type is used for lengthy text or alphanumeric data. Maximum 63, 999 chara
Number Numeric data type used for storing mathematical calculations. 1, 2, 4, 8, and 16 bytes.
Date/Time Store Date/time for the years 100 through 9999. 8 bytes.
Currency It allows you to store currency values and numeric data with one 8 bytes.
to four decimal places.
Auto Assign a unique number or assigned by Microsoft Access when Four bytes (16 bytes if it
Number any new record is created. Usually used as the primary key Replication ID).
Yes/No It only stores logical values Yes and No. 1 bit
Attachment It stores files, such as digital photos. Multiple files can be Up to 2 GB Data can be
attached per record.
OLE objects OLE objects can store audio, video, other Binary Large Objects. Up to 2 GB data can be s
Hyperlink Text or combinations of text and numbers stored. That text is Each part of a Hyperlink
used as hyperlink address. you to store a maximum
Calculated Helps you to create an expression that uses data from one or You can create an expres
more fields. from one or more fields.
Access Excel
Deals with text, numbers, files and all kinds of data Microsoft Excel generally deals with num
All the data is stored one time, in one place. Lots of worksheets or documents are a st
repeated data.
Helps you to build highly functional data entry forms and report Only the primary data entry screen is ava
templates.
Users will be able to enter the data more efficiently and Data accuracy and speed is not much bec
accurately.
Advantages of MS Access
Now in this MS Access Tutorial, we will learn the pros/benefits for using MS
Access application:
Access offers a fully functional, relational database management
system in minutes.
Easy to import data from multiple sources into Access
You can easily customize Access according to personal and
company needs
Microsoft Access online works well with many of the development
languages that work on Windows OS
It is robust and flexible, and it can perform any challenging office or
industrial database tasks.
MS-Access allows you to link to data in its existing location and use it
for viewing, updating, querying, and reporting.
Allows you to create tables, queries, forms, and reports, and connect
with the help of Macros
Macros in Access is a simple programming construct with which you
can use to add functionality to your database.
Microsoft Access online can perform heterogeneous joins between
various data sets stored across different platforms
Disadvantages of MS Access
Here, are the cons for using MS Access
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 reverence.
Step 3) File name box will appear with the default file name.
Step 4) Enter the new Name.
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.
Step 4) Enter the new 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 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'
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.
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.
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.
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 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.
Form Wizard
Form
Multiple Item
Split Form
Let's have a look at each option to create the form, one by one:
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.
2. Create using Form
It is the simplest way to create the form which will:
By default, populate all the column from the selected table in 'form
view,'
The user can delete non-required column manually
Step 1) Select the table for which we want to create the form and click on
'Form.'
Step 2) Below window will appear.
Step 3) Right-click on any cell which we don't want to be part of final forms
and click on 'Delete.'
Step 1) From the 'Create' tab. Click on 'More forms' and select 'Multiple
Items.'
Result: Below Multiple lines, the window will appear
Step 2) Press 'Ctrl+S'. Enter the new form name and click 'OK.'
Result: New Form with the name as 'Contact_Form_Multiple_Item' exists
under the "Forms" section.
Step 1) From the 'Create' tab, click on 'More forms' and select 'Split Form.'
Result: Below window will appear with the Form and data sheet together.
Step 2) Press 'Ctrl+S' and enter the new form name. Click 'OK.'
Result: New Form with the name as 'Contact_Form_Split' exists under the
"Forms" section.
Edit the existing record via Form.
One of the features of forms is that we can edit the values and data
directly from the form.
It is more user-friendly because as compared to row format in the
table, forms have better visibility of selected fields and the user can
do the direct updates.
These values updated from forms will also be reflected in original
tables immediately.
Report
A report is an object in MS Access that is designed for formatting,
calculating and printing selected data in an organized way.
It contains information from tables and also information that are there
in the report design.
Reports are helpful as they allow you to present all information of
your database in an easy-to-read format.
Step 1) Click on 'Phone Book' under 'Report' section. The system will open
the inbuilt 'Phone Book' report.
It will display Contact Name, Home, Business and Mobile name displayed
Step 1) Click on 'AutoExec' under 'Report' section. The system will open
the inbuilt 'Welcome' Macro. It will display Welcome note and other data
related to contacts Database which has its code into default 'AutoExec'
Macro
Step 2) If you want to see the code behind this macro right click.
Result:
Module
It is a collection of user-defined functions, declarations, statements,
and procedures that are stored together as a unit.
It perhaps a standalone object having functions that you can call from
anywhere in your Access database.
Result:
Summary
Microsoft Access is a Database Management System offered by
Microsoft.
Allows you to create tables, queries, forms, and reports, and connect
with the help of Macros
MS-Access will enable you to link to data in its existing location and
use it for viewing, updating, querying, and reporting.
Access consists of four main database objects: Tables, Queries,
Forms, and Reports.
There are two ways to create Database in SQL Access:
o Create Database from Template
o Create a Blank Database
There are two ways to create Database in MS Access
o Create a Table from Design View
o Create a Table from Datasheet View
You can switch between the datasheet and the design view by just
clicking the 'View' button in the top-left hand corner of the Access
program.
A form can be created using Form Wizard, Form, Multiple Item, Split
Form
Macro in MS Access database is a time-saving feature that allows
you to add functionality or automate simple tasks.
A report is an object in MS Access that is designed for formatting,
calculating and printing selected data in an organized way.
A Module is a collection of user-defined functions, declarations,
statements, and procedures that are stored together as a unit.