Download presentation
Presentation is loading. Please wait.
1
Microsoft Access Overview
Lydia Scheer, ITEP 1-1: Access Review
2
The Database Environment
Access is a relational database Data stored with Access are related to one another in multiple ways Access maintains the data relationships when database is structured correctly MS Excel (or other spreadsheets) are considered “flat” file databases Rows and Columns of data that may be related Excel has no way of maintaining relationships automatically 1-1: Access Review
3
How do Relationships Work?
A relationship works by matching data between tables based on values in key fields. In most cases, these matching fields are the primary key from one table, which provides a unique identifier for each record, and a foreign key from another table.
5
Relationships Window View, define, and modify relationships
Tools (Menu)Relationships… or right-click on database window (white area) to view Join lines indicate type of relationship (1=one-side; = many side) Double-click on a join line to modify relationship Tables/field lists are moveable/sizeable A table can be related to multiple tables, but only by ONE field at a time
6
Types of Relationships
One-to-One Item (record) in Table A related to only one item in Table B Not common because usually the information is stored all in one table Example: Data archive table; Subset of information that would result in too many blank fields in main table (confidential info, instructors, etc.) One-to-Many or Many-to-One One item in Table A can be related to multiple items in Table B Example: One site has multiple (many) monitors; One person has multiple visits to the clinic Many-to-Many Combination of two One-to-Many relationships Example: One person has multiple visits to the clinic; One clinic has multiple people visit. Some Many-to-Many relationships are not immediately obvious (Example: One site has multiple monitors, but does a monitor have multiple sites?)
7
Join Lines (Identify Relationships
8
The Structure of Access
The Structure of Access Database File: This is your main file that encompasses the entire database and that is saved to your hard-drive or floppy disk. Example: DMExample.mdb Table:A table is a collection of data about a specific topic. There can be multiple tables in a database. Example #1: tblFIPSCodes Example #2: tblAQS_Ozone Field:Fields are the different categories within a Table. Tables usually contain multiple fields. Example #1: FilterID Example #2: Date Datatypes:Datatypes are the properties of each field. A field only has 1 datatype. FieldName: FilterID Datatype: Number Value: The Data. Example (FilterID):
9
The Database Window Default view when database is opened
Lists all available database objects Tables, Queries, Forms, Reports, Pages, Macros, Modules Lists all available database object groups A way of organizing shortcuts to objects that are related Create groups specific to your project/needs (e.g. “Favorites”) Toolbar across top has commands for database objects Open, Design, New, Delete View style (4 buttons on the left)
10
The Database Window
11
Object Views Datasheet View Form/Page View Print Preview Design View
Tables, Queries, Forms Standard table view – “spreadsheet style” Form/Page View Standard form view or page view Print Preview Standard view for Reports Can also be used with Forms, Tables, Queries & Pages Design View Applicable to all database objects Layout/view is specific to the database object Make changes to the structure/format/layout of object 1-1: Access Review
12
Database Objects-Tables
Used for storing data in rows and columns Rows = Records; Columns = Fields Records are UNIQUE collections of data about “something” (e.g. a person, a PM filter, etc.) Fields are categories of data for a set of records Tables contain information about one subject only Primary Key field in a table is a unique identifier for each record—no null values or duplicates Tables can have up to 255 fields, and can store up to 1 gigabyte (GB) of data per table Tables contain info about one subject only—for instance you will probably store all the data from your filter run (sample data) in one table. All information about the sampler itself in another table, and all information about sites in a different table. Depending on the demand/focus of your project you may find it sufficient to store the meteorological components of your filter run data in a separate table, or something like that….or if your datalogger provides things like average concentrations… 1-1: Access Review
13
Design View Datasheet View
14
Database Objects-Queries
Retrieve sets of data based on user-defined criteria (text strings, expressions, functions) Often used to combine data from multiple (usually related) tables Subsets of data stored in tables; data are not actually stored in queries Perform calculations on or with data Can be constructed to perform an “action” create a new table from query results append records to an existing table update records in an existing table (similar to find and replace, but can use calculations, too)
15
QBE Pane or Query Design View
16
Append Query Grid: Update Query Grid: Delete Query Grid:
Make Table or Append Query Pop-up: Notice: new rows inserted for arguments with action queries (Append To, Update To, Delete) choose field to append to from existing table Update To row: enter an expression or literal value. Can also update based on matching values in a different table 1-1: Access Review
17
Database Objects-Forms
User-friendly way of displaying data for entry or manipulation Programmed actions (macros, modules) can be attached to forms Display data from tables and/or query results Can also be used as a menu (or switchboard), created as custom dialog boxes, or displayed as a datasheet Subforms-form within a form that displays data from a different dataset than that of the main form
18
Data Entry Form (with Tabs)
“Switchboard” Form
19
Database Objects-Reports
Output of information from database (tables or queries) in the form of a printed report Allows you to group and summarize information Can be previewed on the screen prior to printing Can include graphs, data tables, images, and calculations/totals Reports are for publishing data only, not for data manipulation
21
Database Objects- Macros & Modules
Access-specific “mini-programs” Pre-programmed for ease of use Modules Visual Basic for Applications (VBA) programming language More complicated to use properly, but more options and flexibility than macros Both are based on event-driven programming An event (click a button, open/close a form, etc.) triggers an action (macro/module) that carries out a programmed set of commands Most actions have required arguments (user-specified data that tells the event how/when to carry out the action) Must act on a certain object or control on the form or report Can only be attached to forms or reports
23
Adding a Macro or Module (Event Procedure) to a Form Event
Select the control in design view; view the property sheet; Events Tab; Select Event, Select procedure or macro Adding a Macro or Module (Event Procedure) to a Form Event 1-1: Access Review
24
Wizards Access has a number of wizards built in to make it easier to work with each tool Wizards walk you through creating db objects Tables & queries Forms & reports Other items inside above (expressions, events, etc.)
25
Simple Query Wizard asks for a table or query to use for base data
Then you have the option of displaying all records/fields or creating a summary query Final query results (grouped by Month as an option) displays Avg, Min, and Max of monthly PM mass
26
Things to make your life easier…
Naming Conventions Consistency in naming different types of objects, controls, etc. Use identifiers in names (e.g. tbl, qry, frm) that make sense to you NO SPACES or Punctuation in names-harder to deal with in expressions and code procedures Examples: tblSites, qryAQS_OzoneArizona, cmdClose, dap2003SummaryDataPMFineHighestConc Document what you are doing…will you remember what you did (or why) in three months time? Changes made to data are PERMANENT Backup….BACKUP…BACKUP!
27
The Database Window Toolbar
View Objects with Details View Objects as Small Icons View Objects as a List View Objects as Large Icons Create a New Object Open Current Object Delete Current Object View Object in Design View
28
The Database Toolbar (Default)
Help Files View Relationships VBA (Code) Window Publish or Merge with another Office Application Format Painter Copy Spell Checker Print Open another database file View, Edit, or Create Indexes Show Object Properties Analyzer Tool Undo Action Paste or Clipboard Tool Cut Print Preview Save Create a new Database File
29
Table (Datasheet View) Toolbar
New Object (incl. AutoForm & AutoReport) Delete Record(s) Database Window Add/Go To New Record Apply/ Remove Filter Find a Value Filter by Form Filter by Selection Sort Field Data by Ascending Values Sort Field Data by Descending Values Insert Hyperlink ( to Internet or other network location) Print Table Table Print Preview Switch to Table Design View Save Table Design
30
Table Design View Toolbar (also for Query and Form Views)
Field Builder Wizard Table Properties Delete a Row (Field) Insert a Row (Field) View/Set Indexes Set Field(s) as Primary Key Print Table Design View Switch to Table Datasheet View Save Table/ Query/Form Design
31
Query Design View Toolbar
New Object (incl. AutoForm & AutoReport) Expression Builder or Calculated Field Wizard Query Properties Show Top Values (all, 25, 5%, etc.) Create a Totals Query Undo Last Action (only allowed once) Add a table to the QBE Pane Save Query Print Query Design View Switch to Query Datasheet View or SQL View Run Query (select queries display in datasheet view; action queries attempt to run) Choose or Change Query Type (delete, append, select, etc.)
32
Form Design View Toolbar
Expression Builder Wizard AutoFormat Form Design Open VBA Window Properties for selected control(s) Field List-shows available fields for use on the form Font Size Indicator Font Selection Box for controls with dynamic fonts (text boxes, labels, buttons, etc.) Format Font (Bold, Italicize, Underline) Toolbox for Form Controls Identifies the control on the form which has the focus Switch to Form Design or Datasheet View Fill Color, Font Color, Line Color Text Alignment: Left, Center, Right
33
Form/Report Design Toolbox
Label (control) Tool Option (radio) button; Check box Textbox Tool Select Control Tool-Use to select a control on a form or report to modify, delete, move, etc. Command button Insert Page Break Rectangle Tool Create an Option Group Create Combo Box Toggle Button Tool Control Wizard—Selected means wizards will be activated when a tool is chosen to help the user establish the control properly. Deselected means wizards will not be activated when a tool is chosen, and enables the user to design a control with his/her own methods. Create a List Box Create an Unbound Object Frame Line Tool Insert Image or Graphic Click to view more controls for use on forms/reports Tab Control Create a Bound Object Frame Insert a Subform/ Subreport
34
Report Design View Toolbar
Expression Builder Wizard Print Report Show Toolbox Properties for selected control(s) Format Painter Save Report Design Insert Hyperlink Switch between Print Preview, Design View and Layout Preview Print Preview Show Field LIst Sorting/ Grouping Options VBA Window AutoFormat Report Layout
35
Macro Design View Toolbar
Expression Builder Wizard Delete a Row Show/Hide Macro Names Column Save Macro Show/Hide Macro Conditions Column Print Preview Macro Definitions (summary of macro actions and arguments Undo last action (can only use once) Insert a Row Run Macro Step Through Macro Actions
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.