Prepared By: Bobby Wan www.bobbypresents.com Microsoft Access Prepared By: Bobby Wan www.bobbypresents.com
Microsoft Access database A collection of data and objects (such as tables, queries, or forms) that is related to a particular topic or purpose.
About tables (MDB) A table is a collection of data about a specific topic, such as products or suppliers. Using a separate table for each topic means that you store that data only once. This results in a more efficient database and fewer data-entry errors. Is an object that stores data in records (rows) and fields(columns).
About tables (MDB)…2 Create a table by entering data in a datasheet. What is a datasheet? Data from a table, query, form displayed in a row and column format.
About designing a database Good database design ensures that your database is easy to maintain. You store data in tables and each table contains data about only one subject, such as customers. Therefore, you update a particular piece of data, such as an address, in just one place and that change automatically appears throughout the database.
Follow these basic steps when designing your database. Determine the purpose of your database The first step in designing a database is to determine its purpose and how it's to be used. Talk to people who will use the database. Brainstorm about the questions you and they would like the database to answer. Sketch out the reports you'd like the database to produce. Gather the forms you currently use to record your data. As you determine the purpose of your database, a list of information you want from the database will begin to emerge. From that, you can determine what facts you need to store in the database and what subject each fact belongs to. These facts correspond to the fields (columns) in your database, and the subjects that those facts belong to correspond to the tables.
Determine the fields you need in the database Each field is a fact about a particular subject. For example, you might need to store the following facts about your customers: company name, address, city, state, and phone number. You need to create a separate field for each of these facts. When determining which fields you need, keep these design principles in mind: Include all of the information you will need. Store information in the smallest logical parts. For example, employee names are often split into two fields, FirstName and LastName, so that it's easy to sort data by LastName.
Determine the tables you need in the database Each table should contain information about one subject. Your list of fields will provide clues to the tables you need. For example, if you have a HireDate field, its subject is an employee, so it belongs in the Employees table. You might have a table for Customers, a table for Products, and a table for Orders.
Determine which table each field belongs to….1/2 When you decide which table each field belongs to, keep these design principles in mind: Add the field to only one table. Don't add the field to a table if it will result in the same information appearing in multiple records in that table. If you determine that a field in a table will contain a lot of duplicate information, that field is probably in the wrong table.
Determine which table each field belongs to…/2 For example, if you put the field containing the address of a customer in the Orders table, that information will probably be repeated in more than one record, because the customer will probably place more than one order. However, if you put the address field in the Customers table, it will appear only once. In this respect, a table in a Microsoft Access database differs from a table in a flat file database such as a spreadsheet. When each piece of information is stored only once, you update it in one place. This is more efficient, and it also eliminates the possibility of duplicate entries that contain different information.
Identify the field or fields with unique values in each record In order for Microsoft Access to connect information stored in separate tables— for example, to connect a customer with all the customer's orders— each table in your database must include a field or set of fields that uniquely identifies each individual record in the table. Such a field or set of fields is called a primary key.
Determine the relationships between tables Now that you've divided your information into tables and identified primary key fields, you need a way to tell Microsoft Access how to bring related information back together again in meaningful ways. To do this, you define relationships between tables. Relationship: An association that is established between common fields (columns) in two tables You may find it useful to view the relationships in an existing well-designed database. Lastly >Refine your design
Using Microsoft Access You can manage all your information from a single database file. Within the file, you can use: Tables to store your data. Queries to find and retrieve just the data you want. Forms to view, add, and update data in tables. Reports to analyze or print data in a specific layout. Data access pages to view, update, or analyze the database's data from the Internet or an intranet.
Using Microsoft Access Store data once in one table, but view it from multiple locations. When you update the data, it's automatically updated everywhere it appears. Display data in a query Display data in a form Display data in a report Display data in a data access page
Using Access, you can manage all your info from a single database file Access Database Files Using Access, you can manage all your info from a single database file Display data in a query Display data in a form Display data in a report Display data in a data access page
To find and retrieve just the data that meets conditions that you specify, including data from multiple tables, create a query.
To easily view, enter, and change data directly in a table, create a form.
To analyze your data or present it a certain way in print, create a report.
Data Acces Page To make data available on the Internet or an intranet for interactive reporting, data entry, or data analysis, use a data access page
Calculated Field – A field , defined in a query, that displays the results of an expression rather than displaying stored data. Control – is an object you add to a form or report. Calculated Control – A control that is used on a form, report or data access page to display the result of an expression. Result is calculated each time there is a change in any of the values.
Primary Key Is one or more fields (columns) whose value uniquely identify each record in a table. Is used to relate a table to foreign keys in other tables. Foreign keys – one or more table fields (columns) that refer to primary key field(s) in another table. It indicates how tables are related.
parameter queries That prompt for criteria (MDB) A parameter query is a query that, when run, displays its own dialog box prompting you for information, such as criteria for retrieving records or a value you want to insert in a field. You can design the query to prompt you for more than one piece of information; for example, you can design it to prompt you for two dates. Microsoft Access can then retrieve all records that fall between those two dates.
INPUT MASK PROPERTY Placeholder Description 0 A number is required. 9 A number is optional. # A number, a space, or +/- is optional. A space is used if no letter is entered. L A letter is required. ? A Letter is not required. Space is used if no letter is entered. > Any character to the right are converted to uppercase. < Any character to the right is converted to lowercase.