Microsoft Office Access 2010
Microsoft Office Access 2010
Field Properties
It is used to set the field. where the limits data entry as
your required. Field properties are:
a) Field size: - It is used to entry the limit text data
according to define value. You entry the only 7
characters at name field.
b) Format: - It is used to display the small or capital
letter at required field.
- > Display text in capital letter
- < Display text in small letter
Cust_id(P) Item
Name Rate
Address Quantity
Contact No Cust_id
Student
Queries :-
Query is used to search, modify, update, delete and also
set the formula for calculation of table according to
choose query option.
Query design:
This option is used to create the query from selected table
field.
Steps,
1) At first choose the query object of database
windows
2) Click on Query design
3) Show table windows will appear
4) Choose the table name of box
5) After that , click on add button
6) After add table , click on close button
7) Drag the table fields in Grid box by mouse
8) Finally save and open
Discount:[amount]*5/100
NetAmount:[Amount]-[discount]
Result sheet in Query
Field name Data type
Name Text
English Number
Math Number
Computer Number
Nepali Number
Science Number
Total Number
Result Text
Percentage Number
Division Text
Remarks Memo
Formula
Total:[English]+[math]+[computer]+[nepali]+[science]
Percentage:[total]/5
Division:iif([result]=”Fail”,
“fail”,iif([percentage]>=60,”First’’,iif([percentage]>=45,
“Second”, “Third”)))
Remarks:iif([division]=”First”,”Excellent”,iif([division]=”Seco
nd”,”Very good”,iif([division]=”Third”,”Good”, “Try again”)))
Action Query
1) There are four types of action query. They are
To open table
Syntax,
Select* form <table name>
Eg:-
Select* form student
Form
Forms are used for the easy data entry in a table it's
alternative way of data entry on alternative design data can
be edited very easily in the form as well as we can set
different formula in a form to calculate data using "VBA"
(visual basic application) card it means we can use
programming logical of VBA in form of MS Access data base
or form is fronted part of data base.
Access formula
Calculation of interest amount on the basic of no. of years
Sn Name principle no of years amount
Condition:-
1. 18 % interest rate less than 2 years
2. 10% interest rate less than 5 years
3. 8% interest rate for more than 5 years
Formula:
if me. no of years<=2 then
me. amount = me. principle *18/100
else
if me. no of year<= 5 then
me. amount =me. principle *10/100
else
me. amount= me. principle *8/100
end if
end if
Calculation of net amount
Item Total Dis Dis Net
Sn Qty Rate
Name amount Percent Amount amount
Formula:
- Me. Total amount= me. Qty * me. Rate
Billing System
Id, Items name, quantity, rate, amount, Dis_amount, tax,
net amount.
Condition
Tax
>=10000 *13/100
< 10000 *7.5/100
Discount Amount
>=25000 *15/100
>=10000 *10/100
< 10000 *5/100
Amount
Me. amount =me. Quantity × me. Rate
Discount
If me. Amount>=25000 then
Me. Dis amount=me. Amount*15/100
Else
If me. Amount>=10000 then
Me. Dis amount= me. Amount*10/100
else
Me. Dis amount=me. Amount*5/100
End if
End if
Tax
If me. Amount>=10000 then
Me. Tax=me.amount *13%
Else
Me. tax=me.amount *7.5%
End if
Net amount
Me.net amount = me. Amount + me.tax - me.dis amount
Result:
If me.english>=32 and me.math>=32 and me.economic>=32
and me.account>=32 and me.nepali>= 32 then
Me.result= "pass"
Else
Me.result= "fail"
End if
Percentage
me.percentage = me.total mark/ 5 (no of subject)
Division:
If me.total mark >=300 and me.result="pass" then
Me.division = "first"
Else
If me.total mark >=225 and me.result="pass" then
Me.division = "second"
else
If me.total mark >=175 and me.result="pass" then
Me.division = "Third"
Else
Me.division= "fail"
End if
End if
End if
Remarks
If Me.Divison = "First" Then
Me.Remarks = "Excellent"
Else
If Me.Divison = "Second" Then
Me.Remarks = "Very good"
Else
.
If Me.Divison = "third" Then
Me.Remarks = "Good"
Else
Me.Remarks = "Try again"
End If
End If
End If
Telephone bill
sn, Customer Name, telephone no, previous call, current
call, total call, total amount, vat, service charge, net amount
Total Call
Me.Total_call = Me.Current_call – Me.Previous_call
Total amount
Rs.250 is minimum charge of 200 free calls then (out of 200
call) per call Rs. 2
if me.total call<=200 then
me.total amount= 250
else
me.total amount =250+ (me.total call-200)*2
end if
Vat
13% vat of total amount
Me.Vat = Me.Total_amount * 13 / 100
Service charge
10% of total amount
Me.Service_charge= Me.Total_amount*10/ 100
Net Amount
Me.Net_Amount= me.Total_Amount+ me.vat +
me.service_Charge
Preparing salary sheet on the form
Steps:-
At first create table having following fields
Id, name, address, no of children, basic Salary, rank,
bonus, children allowance, medical allowance, tax, net
salary
Condition of rank
- if they have more than 10,000 basic salary they are officer
- if they have less than 10,000 basic salary they are non
officer
Condition of bonus
- if they are officer they will get 15% bonus of basic salary
- if they are non officer they will get 10% bonus of basic
salary
Condition of children allowance
- if they have more than 3 children they will get 14 %
children allowance of basic salary
- if they have more than 1 child they will get 10% children
allowance of basic salary
- if they have no child they wouldn't get children
allowance
Children allowance
If Me.No_of_children >= 3 Then
Me.Children_allowance = Me.Basic_salary * 14 / 100
Else
If Me.No_of_children >= 1 Then
Me.Children_allowance = Me.Basic_salary * 10 / 100
Else
Me.Children_allowance = "0"
End If
End If
Bonus
If Me.Rank = "Officer" Then
Me.Bonus = Me.Basic_salary * 15 / 100
Else
Me.Bonus = Me.Basic_salary * 10 / 100
End If
Medical allowance
If Me.Rank = "officer" Then
Me.Medial_allowance = Me.Basic_salary * 15 / 100
Else
Me.Medial_allowance = Me.Basic_salary * 11 / 100
End If
Tax
Me.Tax = Me.Basic_salary * 13 / 100
Net salary
Me.Net_salary = Me.Basic_salary + Me.Bonus +
Me.Children_allowance + Me.Medial_allowance - Me.Tax
End Sub
To close database
Steps:-
-open form to designing view
-choose the command button on tool box
-drag on required area of form
-type the name (eg. Close )
-right click on command box (name box)
-click on build event
-click on code builder
-click on ok
-and type the formula (command)
Report
Report is an important object of database, which is used
to view and print out particular data of table as a final
report if we need particular report at first we have to define
the data by using query then report
Use can be able to prepare report on ms- database by
two methods
Creation report in design view
Steps:-
1. click on report object
2. click on create menu
3. click on report
4. then click on view
5. click on design view
6. Then user define required tools for design
Macro:-
Macro is a set one of more actions that is each per form
a particular operation, such as opening a form or printing a
report macro can help you to automate command task for
example you can run a macro that prints a report.
Creating a macro
Steps:-
1. Choose macro object
2. Click on create menu
3. Click on macros
Module:-
This is an important object of database which is used to
create simple bills using programming code. Defining
constraint and other logic
eg. loops etc
steps:-
1. choose module object on database window
2. click on new
3. define constraints as user need
4. create form on design view
5. create connection between form and database
6. finally save then run the form
The End