Professional Documents
Culture Documents
Object of Ms-Access:
1.Table
2.Query
3.Form
4.Report
5.Macro
6.Pages
7.Modules.
Table:- It is a combination of columns and rows. In Ms-Access you can create up to 255
tables in a single database where each and every table content 256 columns and unlimited rows.
It's a man of database. It holds all are records as content.
Query:- It is a conditional selection of database without a table, Query can not be created. It
always fetches a record from table as the specific criteria.
Form:- It is also know as a front end of database. It is used to Manipulate the table records by
using this you can update ever more then one table at a time, which the help of macro.
Report:- It is used for distribution propose or printing propose.
Macro:- It automate a particular field. It is a set of action, which can be assigned at particular
event to the different objects/control.
Pages:- It is used for internet propose.
Modules:- It is a core part Ms-Access programming.
Table: A table has two different view:
1. Datasheet View:
It's the default view of table. In this view you see the actual records stored in table.
2. Design View: In this view, we design the structure of table
Parts of design view
I. Field name: In this column you can give the name of field that you want on
table.
II. Data Type: It defined the type of data what you would enter in particular
field. It invalid data entered you will be stopped to go forward.
Text : It allows any combination of a-z, 0-9 and some symbols. Its minimum length
is 255 characters. Its default length is only 50 characters.
Memo : It is similar to text but lengthy up to 65535 characters.
Number: It accepts only combination of number (0-9) calculation can be done.
Currency: It is similar to number but it also accepts prefix or suffix.
Auto Number: It provides a unique number automatically to the particular field.
Date/Time: It accepts any format of date or time.
Character Discretion
> It used is character to capital letter.
< It used is character to small latter.
Character Discretion
0 any single digit
(0-9)
9 any single digit (0-9) or space.
# any single digit (0-9) or space.
Caption:- By using this properties you can change the field heading
Default value: It daffiness the default value to the particular field. It automatically inserts
the value when new record is generated.
Validation Rule:- You can use this property to make a validation rule for the particular
field.
For Example:- "Manager" or "Accountant",
10000 or < 15000
Validation Text:- You can use this properties to display own text or massage when text
violets the validation rule.
For Example :- Sorry valid only 10000 to 15000.
Required:-You can set this property to YES if the particular field never contain null value.
Devendra Sah (Rajbiraj-7) 2
Indexed: -
No - No indexing.
Yes (Duplicate Ok) - Indexing but duplicate value also accept.
Yes (No duplicate) – Indexing but duplicate value not allowed.
V) Column Heads:
Yes :- To display the heading of column is combo box.
No :- To hide the heading of column is combo box.
For Eg.
Post
Relationship:
An association between two or more than two table are called relationship. There are
three kinds of relationship, they are:
i) One to one Relationship.
ii) One to many Relationships.
iii) Many to many Relationships.
Importance of Relationship:
It establishes a relation between two or more table.
It prevent from redundancy.
It defines a field unique.
Record can be fetch (bring) from other table.
I) One to one Relationship:
In this relationship each record in table A can have only one matching record in table B
and each record in table B can have only one matching record in table A.
Example: Admission Table Result sheet
Stud Code Stud code
Name English
Address Nepali
Phone Math
II) One to Many Relationship:
In this relationship a record is table A can have many matching records in table B but a
record in table B has only one matching record in table A.
Example: Admission Receipt Table
[PM] Student code Student code
Name Rec. Date
Address Rec. Amount
Phone
III) Many to many Relationship:
In this relationship a record in table A can have many matching record in table B and
table B has many matching records in table C.
Example: Item Table Order Table Customer Table
[PM] Item Code Ord. No. Customer ID
Name Customer ID Name
Quantity Order date Address
Rate Quantity Phone
Item Code E-male
Rate
# To make a relationship between table:
1. First create the both table A and B.
2. Click on relationship tool available on toolbar.
# To make a Query:
1. Double click on Create query using wizard.
2. Select the Name of Table and its field which you want on query.
3. Click on Next Next Finish
# Create a query using Design View:
1. Double click on create query giving Design view.
2. Add a table by which you want to make a query.
3. Click the available field and drag and drop to down at grid.
Formula:
Aount = Amt: [Qty]*[Rate]
Dis = Dis: [Amt]*5/100
Net Amount = Net Amt: [amt]-[dis]
5. Save the query and run as many times as the number of fields are to be update.
# Delete Query: It is used to delete the records from table based the specified criteria.
1. Design the Simple Query and open it in design view.
2. Pass the criteria or conditional in criteria field.
3. Click on query menu and then click on delete query.
4. Save the query and run it to delete the record which has quantity greater than 100.
# Append Query: It is used to append or insert the records of Table A to Table B.
1. Design a Query Just as select query.
Devendra Sah (Rajbiraj-7) 7
2. Click on Query Menu. and then click on Append Query.
3. Select the name of query in which you want to append.
4. Click on Ok.
5. Save the query and run it.
# Make Table Query: It makes a new table of selected field from existing table. You can
create it by Query in the same database or existing database.
1. Double click on Create Query in Design View.
2. Add a table from which you want to pick a field or fields.
3. Drag and drop the required field.
4. Click on Query Menu and then make table query.
5. Enter the name of Table, which will create, on the execution of this Query.
6. Click on Ok.
7. Save the Query and Run It.
FORM: It is a form of database by this you can manipulate records or table entry. You can use
form to make an entry that is automatically update to A and form B.
Back
# Creating A Form:
1. Double click on create form by using wizard.
2. Select the name of Table or Query for which you want to make form.
3. Also select the required field of Table or Query which you want on Form.
4. Click on Next.
5. Select a layout of form column, tabulation and click on Next.
6. Select a style of form you like and click on Next.
7. Give the name of form and click on Finish.
Eg:- * Item code
*Result Sheet
Item Name
Quantity
Rate
Amount
Discount
Inserting command buttons in form
1. Turn on the control wizard available on tool box.
2. Click command button tool and insert into form.
As soon as you place a command button you get control wizard box.
3. Select appropriate categories and action you want to happen when the button is pressed.
Categories Actions
Record Navigation Add New Record
Record Operation Delete Record
Form Operation Save Record
Report Operation etc.
Application
Devendra Sah (Rajbiraj-7) 8
Miscellaneous
4. Click on Next.
5. Select Text or picture, which you want on the button. * Add
6. Click on Next.
7. Enter Name of button and the click on Finish.
In the same way insert more buttons in form for eg.
# Macro: Macro is a set of action that can be executive at an event or assign it to a control.
Action of Macro [Assume , that Macro is for Amount]
1. Click on New on Macro object.
2. Select on action and enter its expression.
Action Comment
Set value
Item
Item [Forms]![Item]![Amount]
Expression [forms]![item]![rate]* [forms]![item]![qty]
3. Save the Macro.
Eg. McrAmt
4. Now, tag the macro with a control on particular even you want to happen.
5. On got focus
Conditional Macro
1. Click on view menu in Macro Design view.
2. Click on Condition.
Condition Action Comment
Discount calculation:
If Amount > 10000 then 5% otherwise (<=10000) then 2%
Steps:
1. Write the given in condition column [Amount] >10000
2. Write the given in Action Set Value
3. In Argument Item [Form ! [Item] ![amt]![dis]
Expression [forms ! [Item]![Amt]*5/100]
4. Save the Macro and set on Got Focus of discount field.
View of Report
1. Design view: It helps to design the structure of report how you want to display on page.
2. Print preview: It displays the page how it will look after printing.
Part of Design View
1. Report Header
2. Page Header
3. Page Footer
4. Report Footer
To create a report:
1. Double click on “Create Report By using wizard”
2. Select the name of table for Query and its fields, which you want on your report.
3. Click on Next.
4. Select A Field Name if you want to group according to its value.
5. Click on Next.
6. Select an order for sorting data and click on Next.
7. Select a layout for report, which you want and click on Next.
8. Select a style for report you like most and click on Next.
9. Lastly, click on Finish.
The End