MS Access-Object
MS Access uses “objects” to help users list and organize information, as well as prepare specially designed reports. When you create a database, Access provides you with tables, queries, forms, reports, macros, and modules. Access consists of many objects but following are the main ones −
sheet
Inquire
sheet
Report
Together, these objects allow you to enter, store, analyze, and compile data. The following is a summary of the main objects in an Access database;
Sheet
A table is an object used to define and store data. When you create a new table, Access asks you to define fields, also called column headers.
- Each field must have a unique name and data type.
- Tables contain fields or columns that store different types of data, such as names or addresses, and records or rows that collect all information about a specific instance of a subject, such as all information about an object. Customers or employees etc.
- You can define a primary key, one or more fields with unique values for each record, and one or more indexes on each table to help retrieve data faster.
Inquire
An object that provides a custom view of data from one or more tables. A query is a method of searching and compiling data from one or more tables.
- Running a query is like asking the database detailed questions.
- When you build a query in Access, you are defining specific search criteria to find exactly the data you need.
- In Access, you can use the sample tools to make graph queries, or you can write Structured Query Language (SQL) statements to create queries.
- You can define queries to select, update, insert, or delete data.
- You can also define queries to create new tables based on data from one or more existing tables.
Form
A form is an object in a desktop database that is primarily used for data entry or display or for controlling application execution. You can use forms to customize how your application represents the data it extracts from a query or table.
- Forms are used to enter, modify, and view records.
- The reason forms are used so frequently is that they are an easy way to guide people into entering data correctly.
- When you enter information into a form in Access, the data goes exactly where the database designer intended in one or more related tables.
Report
A report is an object in a desktop database designed to format, calculate, print, and summarize selected data.
- You can view the report on the screen before printing it.
- If a form is used for input, then a report is used for output.
- You’ll need a statement for anything you plan to print, whether it’s a list of names and addresses, a financial summary for a period, or a set of mailing labels.
- Reports are very useful because they allow you to present the components of your database in an easy-to-read format.
- You can even customize the appearance of your report to make it more visually appealing.
- Access enables you to create reports from any table or query.
Other MS Access objects
Now let us look at other MS Access objects.
Macro
This object is a structured definition of one or more actions that you want Access to perform in response to the defined event. Access macros are scripts that perform some work. For example, to create a button that opens a report, you can use a macro that triggers the OpenReport action.
- You can include simple conditions in a macro to specify when one or more actions in the macro are performed or skipped.
- You can use macros to open and execute queries, open tables, or print or view reports.
- You can also run other macros or Visual Basic procedures from within a macro.
- Data macros can be attached directly to table events, such as inserting new records, editing existing records, or deleting records.
- Data macros in web applications can also be independent objects that can be called from other data macros or macro objects.
Module
A module is an object in a desktop database that contains a custom procedure written in Visual Basic. Modules provide a more discrete flow of operations and allow you to catch errors.
- Everything that can be done in a macro can also be done in a module, but you don’t get a macro interface that prompts you for what each action requires.
- Modules are much more powerful and are crucial if you plan to write code for a multi-user environment, as macros cannot contain error handling.
- A module can be a standalone object that contains functions that can be called from anywhere in the application, or it can be directly associated with a form or report to respond to events on the associated form or report.