Professional Documents
Culture Documents
Basic Level
Updated 5/27/05
Navigate Access
To work with all the objects in a Microsoft Access database, use the Database window.
• Return to the Database window by clicking Database window on the Standard toolbar.
View Objects
• Double-click an object in the Database window to open it OR select the object and then click Open
• To open the object in Design view, select the object in the Database window and then click Design OR hold [Ctrl]
when you double-click the object.
• Switch views by clicking the View button on the Standard toolbar. It’s the first button on the toolbar when an object is open.
Its icon image will change based on which view you are currently in.
• When an object is open, you may use the navigation buttons in the lower-left corner of the window.
Total Records
First Next New Record
Previous Last
Print Objects
• Preview an object by clicking Print Preview on the Standard toolbar OR go to the File menu and select Print Preview
OR right-click the object in the Database window and select Print Preview.
• Click Close on the Print Preview toolbar to return to Design view.
• Print one copy of your document on the default printer by clicking Print on the Standard toolbar.
• Change your print options by going to the File menu and select Print OR press [Ctrl][P] OR right-click the object in the
Database window and select Print .
Create a Database
Click New on the Standard toolbar or press [Ctrl][N]. You must first save your database before you can create any objects.
TABLES
A field is represented as a column in a table. Fields are small items of information such as the last name or the date of birth of a
person. The same field can appear in more than one table in a database, which then enables those tables to be linked.
Records are represented as a row in a table. A record is a set of information about one particular item. For example one record about
a person could contain their title, initials, last name, address, city, postcode and date of birth.
Design a Table
1. Click Create table in Design view in the Database window.
2. Give each field a Name (it’s best to use single words or use the underscore to create a space).
3. Choose a Data Type. The field properties below will change depending on the data type chosen.
Data type Use for Size
Text Text or combinations of text and numbers, such as addresses. Also numbers that do not Up to 255 characters. Microsoft Access only stores the
require calculations, such as phone numbers, part numbers, or postal codes. characters entered in a field; it does not store space
characters for unused positions in a Text field
Memo Lengthy text and numbers, such as notes or descriptions. Up to 64,000 characters
Number Numeric data to be used for mathematical calculations, except calculations involving money 1, 2, 4, or 8 bytes
(use Currency type).
Date/Time Dates and times. 8 bytes
Currency Currency values. Use the Currency data type to prevent rounding off during calculations. 8 bytes
Accurate to 15 digits to the left of the decimal point and 4 digits to the right.
AutoNumber Unique sequential (incrementing by 1) or random numbers automatically inserted when a 4 bytes
record is added.
Yes/No Fields that will contain only one of two values, such as Yes/No, True/False, On/Off. 1 bit
OLE Object Objects (such as documents, spreadsheets, pictures, sounds, or other binary data), created Up to 1 gigabyte (limited by disk space)
in other programs using the OLE protocol, that can be linked to or embedded in a table. You
must use a bound object frame in a form or report to display the OLE object.
Hyperlink Field that will store hyperlinks. A hyperlink can be a UNC path or a URL. Up to 64,000 characters
Lookup Wizard Creates a field that allows you to choose a value from another table or a list of values using The same size as the primary key field that is also the
a combo box. Choosing this option in the data type list starts a wizard to define this. Lookup field; typically 4 bytes
4. Give each field a Description. What you type as a description will appear in the Status bar when that field is active, so you can
include instructions as well.
Character Description
0 Digit (0 - 9, entry required; plus and minus signs not allowed).
9 Digit or space (entry not required; plus and minus signs not allowed).
# Digit or space (entry not required; blank positions converted to spaces, plus and minus signs allowed).
L Letter (A through Z, entry required).
? Letter (A through Z, entry optional).
A Letter or digit (entry required).
a Letter or digit (entry optional).
& Any character or a space (entry required).
C Any character or a space (entry optional).
. , : ; - / Decimal placeholder and thousands, date, and time separators.
< Causes all characters that follow to be converted to lowercase.
> Causes all characters that follow to be converted to uppercase.
Causes the input mask to display from right to left. Characters typed into the mask always fill it from left to right. You can include the exclamation point
!
anywhere in the input mask.
Causes the character that follows to be displayed as a literal character. Used to display any of the characters listed in this table as literal characters (for example,
\
\A is displayed as just A).
Password Creates a password entry text box. Any character typed in the text box is stored as the character but is displayed as an asterisk (*).
FORMS
Design a Form
• Make sure Forms is selected and click New in the Database window. You can create the form in Design view, using a Wizard
or choose an Autoform. When creating a form in Design view, choose the table or query where the data comes from. The field
list should be visible with the form. If not, click Field List to view.
• Drag the fields from the field list and place them in the approximate location you’d like them displayed.
• If you delete a control’s label during the design process, you can easily attach a new label to the control.
Create a label, select it, and cut it from the form. Then select the control that needs the label and paste.
Use the Toolbox tools to create objects. If the Toolbox is not visible, click Toolbox .
Label displays descriptive text. Use [Shift] Text Box (unbound to any existing field in the Option Group used along with check boxes,
[Enter] to create line breaks in the label. underlying record source) display the results of a option buttons, or toggle buttons to display a set of
calculation, or accept input from a user alternative values
Toggle Button used as a stand-alone control Option Button used as a stand-alone control Check Box used as a stand-alone control
bound to a Yes/No field bound to a Yes/No field bound to a Yes/No field
Combo Box combines the features of a list List Box displays a scrollable list of values to Command Button used to perform actions,
box and a text box where you can type in the text box select from to enter a value into a new record or to such as Submit, Print or Apply Filter
or select an entry in the list box to add a value to an change the value in an existing record
underlying field
Image displays a static picture on a form or Unbound Object Frame displays an unbound Bound Object Frame used to display OLE
report OLE object, such as a spreadsheet, on a form or objects, such as a series of pictures, on a form or
report and the object remains constant as you move report and is for objects stored in a field in the form’s
from record to record or report’s underlying record source
Page Break begins a new screen on a form or Tab Control used to create a tabbed form with Subform/Subreport used to display data from
a new page on a printed form or report several pages more than one table on a form or report
Line used to emphasize related or specially Rectangle used for graphic effects, such as More Controls
important information or to divide a form or page into grouping a set of related controls, or used for
different sections emphasizing important data
Expression box is where you build the expression. Use the lower section of the builder
to create elements of the expression, and then paste these elements into the expression
box to form an expression. You can also type parts of the expression directly into the
expression box.
Contains folders that list the table, query, form, and report database
objects, built-in and user-defined functions, constants, operators, and
common expressions.
Lists the values, if any, for the elements you select in the left and middle boxes.
For example, if you click Built-In Functions in the left box and a category of
functions in the middle box, the right box lists all built-in functions in the selected
category
RELATIONSHIPS
Establish Table Relationships
The table that initiates the relationship is considered the base or parent table and related tables are considered child or children tables.
A primary key from another table is considered a foreign key. It is foreign because it does not really belong in the table, but is used for
linking purposes only.
1. With the Database window open, click Relationships on the Standard toolbar.
2. Click Show Table and select the tables that require relationships and click Add . Close the dialog box when finished.
3. You can move and resize the tables for better viewing.
4. Select a field in one table and drag it to a field in another table. The Edit Relationships dialog box will open.
• Enforce Referential Integrity – a system of rules that Access uses to ensure that relationships between records in related
tables are valid, and that you don’t accidentally delete or change related data.
Cascaded update and deletes are only operative in the parent table.
To print the relationships, go to the File menu and select Print Relationships… There are three types of relationships:
One to One (i.e. Employee Q Salary)
Work with Subdatasheets One to Many (i.e. Customer J Orders)
Many to Many (i.e. Products Q Orders)
In a subdatasheet, you can view and edit related or joined data in a table, query, or
form datasheet, or in a subform. You can have a total of 8 subdatasheets including the original datasheet; however, each subdatasheet
can include only one subdatasheet at a time.
• Go to the Insert menu and select Subdatasheet… A plus sign + will be in the first column in front of each record.
5. Click Run on the toolbar to run the query. The resulting dynaset will be displayed.
Define Criteria
Criteria is NOT case-sensitive and is evaluated in a left to right manner from top to bottom of the design grid. Because of this, careful
consideration is required when utilizing multiple AND/OR conditions.
LIKE with wildcards will define criteria that searches for part of a field instead of matching the whole field.
AND condition includes data where all criteria must be true to receive a resulting dynaset.
OR or IN(x,y,z) conditions includes data where only one criterion must be true to receive a resulting dynaset.
IS NULL condition finds records with empty data.
BETWEEN X AND Y condition finds records with data that falls between the values of X and Y which you provide.
LIKE "*" & [Enter any character to search by: ] & "*" searches for words that contain the specified character.
Layout a Report
• Double-click Create Report in Design View under the Report objects.
• Use the Toolbox tools to create objects. (See Design a Form for toolbox tool descriptions)
Speed up design by grouping objects
1. Select the objects you want to group.
2. From the Format menu and select Group. Access displays a rectangle around the objects whenever you select an object from
that group. You can then move, size and format all of the objects in the group at once.
3. To remove a group (but retain the individual objects), select an object to display the grouping rectangle and go to the Format
menu and select Ungroup.
• Click the One-Page view , Two-Page view , or Multi-Page view to see the pages of your report.
Database Jargon
Caption — A name displayed on a label or the name displayed in the title bar at the top of a window or dialog box.
Control — An object placed within a form, report or data access page that is used to display, enter, or edit data in a table. (i.e. textbox,
combo box, command button or rectangle)
Database — A collection of information organized by fields, records, and files. Think of a database as an electronic filing system.
Datasheet — Data from a table, form or query that is displayed in a row and column format.
Dynaset — A set of records produced by running a query or by applying a filter. A dynamic set of data that is subject to change.
Expression — A combination of operators, constants, literals, functions and field names that evaluate into a single value.
Field — A space (column) allocated for a particular item of information.
Foreign Key — A primary key from another table.
Form — An object you can use to enter, change and view records of data. You can use a form to display records on the screen or in print.
Leszynski Naming Convention (LNC) — The de facto standard for most Access developers. In essence, the LNC's convention is to
name each object in your database using a three-letter prefix, called a tag. The tag identifies the object’s type. It is typed in lowercase
letters before the object’s name, which begins with a capital letter. (i.e. tblCustomers) As a general rule, you should avoid using
spaces in your object names. tbl: Table, frm: Form, qry: Query, rpt: Report, mcr: Macro
Normalize — A database technique in which duplicate or redundant information in a database is minimized.
Null Field — A field that contains no data.
Object — An identifiable unit such as a table, form report or control that you can select and manipulate as a unit.
Primary key — A way of uniquely identifying a record, such as a Social Security number or employee number.
Query — A request for information from a database.
Record — A complete set of information. Records are composed of fields, each of which contains one item of information. A set of
records constitutes a file. For example, a personnel file might contain records that have three fields: a name field, an address field,
and a phone number field.
Referential Integrity — Rules employed in relational database schemes that are used to preserve the links between tables when you
add, update or delete records.
Report — A formatted and organized presentation of data.
Subdatasheet — A view of data from a table, form, or query that relates to another table using key fields.
Table — Refers to data arranged in rows and columns. In relational database management systems, all information is stored in the
form of tables.
page 10 Shared Computing Services