Microsoft Access


Databases

In simple terms, a database is any collection of related information. Address books, inventories, collections, and almost any other list or set of lists is a database.

The data in a database are stored in "tables" that resemble spreadsheet files. Each record is a row of information. The individual facts within a record are known as "fields" of data. Fields are usually presented as columns within the table. Imagine a Rolodex system, with addresses on 3x5-inch cards. Each address is called a "record" in database terms. Each line on the card might be a "field" of data, such as a street address or home phone number.

Important database terms:

  • Database: Any collection of related information.
  • Record: A single set of data referring to a single object, such as a person or part.
  • Field: Smallest part of a record; the individual facts within the record.
  • Table: A collection of records, often displayed in a spreadsheet-like grid.
  • DBMS: Database Management System.
  • Flat-File: A table without any relationships to other tables. Address books are often flat-file tables.
  • Relational Database: A collection of related tables.

Parts of an Access database

The parts of an Access database include:

  1. Tables: Raw data, organized as records (rows) and fields (columns).
  2. Queries: Filtered and / or merged tables.
  3. Forms: Graphical screens used for data entry.
  4. Reports: Used to analyze the contents of tables and queries.
  5. Macros & Modules: Programming code, which most Access users avoid.

Steps in designing a database

It is important to design a database carefully. A good database design is essential to create a database that works effectively, accurately, and efficiently.

  1. Determine the purpose of your database.
  2. Determine the tables you need in the database.
    • A table should not contain duplicate information, and information should not be duplicated between tables.
    • Each table should contain information about one subject.
  3. Determine the fields you need in the tables.
    • Relate each field directly to the subject of the table.
    • Include all the information you need.
    • Store information in its smallest logical parts (for example, First Name and Last Name, rather than Name.)
  4. Identify fields with unique values.
  5. Determine the relationships between tables.
  6. Refine your design.

Creating a database

Microsoft Access provides two methods to create a database.

  1. Create a database using a Database Wizard: Create the basic required tables, forms, and reports for the type of database desired.
  2. Starting with a Blank Database: The database designer creates tables, forms, and other objects as needed.

Create a database using the Database Wizard

When Microsoft Access first starts, a dialog box is displayed with options to create a new database or open an existing one.

  1. Click Database Wizard, then click OK.
  2. On the Databases tab, double-click the icon for the kind of database you want to create.
  3. Specify a name and location for the database.
  4. Click Create to start defining your new database.

Create a database without using a wizard

When Microsoft Access first starts up, a dialog box is displayed with options to create a new database or open an existing one.

  1. Click Blank Database, then click OK.
  2. Specify a name and location for the database and click Create.
  3. Create the objects that will make up the database.

Tables

Without tables, there would be no databases. All information is stored in tables.

Planning a table design

Before creating any table, the design should be planned. Consider the fields required and then use the following guidelines to plan a database table.

Field names

Names can be up to 64 characters long and can include any combination of letters, numbers, spaces, and special characters except a period (.), an exclamation point (!), an accent grave (‘), and brackets ([]).

  • Avoid including spaces in object names.
  • Avoid using extremely long names.

Data types

Every field has a "data type" used to regulate user input. Data types also determine what functions can be performed upon a field.

DATA type Use for Size
AutoNumber Often the primary key. Unique sequential or random numbers inserted when a record is added. 4 bytes
Text Text or combinations of text and numbers, such as addresses. Also numbers not requiring calculations, such as phone numbers, part numbers, or postal codes. Up to 255 characters
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, which use the Currency data type. 1, 2, 4, or 8 bytes
Currency Currency values. Use the Currency data type to prevent rounding off during calculations. Accurate to 15 digits to the left of the decimal point and 4 digits to the right. 8 bytes
Date/Time Dates and times. 8 bytes
Lookup Wizard Creates a field that allows you to choose a value from another table or from a list of values using a combo box. Varies
Yes/No Fields that will contain only one of two values, such as Yes/No, True/False, On/Off. 1 bit
Hyperlink Field that will store hyperlinks. A hyperlink can be a UNC path or a URL. Local files are stored as "#path\file.ext#" or "Display Name#path\file.ext#" Up to 64,000 characters
OLE Object Objects such as Microsoft Word documents, Microsoft Excel spreadsheets, pictures, sounds, or other binary data created in other programs. Up to 1 gigabyte

Keys and index fields

Each table should include a field or set of fields that uniquely identify each record in the table. This unique value is called the primary key of the table. Access prevents any duplicate or null values from being entered into the primary key fields.

  • AutoNumber primary keys: AutoNumber fields automatically enter a sequential number as each record is added to the table. Using an AutoNumber field as the primary key for a table is the most common approach.
  • Single-field primary keys: If a field contains unique values such as ID numbers or part numbers, designate that field as the primary key.
  • Multiple-field primary keys: In situations where the uniqueness of any field cannot be guaranteed, designate two or more fields as the primary key.

Creating a new table

Microsoft Access provides four ways to create a blank (empty) table:

  1. Use the Database Wizard to create the tables, forms, and reports required for an entire database.
  2. Use the Table Wizard to choose the fields for your table from a variety of predefined tables.
  3. Enter data directly into a blank datasheet. Access analyzes data and assigns the appropriate data type and format for each field.
  4. Use Design View to specify all table details from scratch. Use table Design View at any time to customize or redesign tables.

Create a table using Datasheet View

If data are ready and the desired table is going to be simple, then it is possible to enter data first and then modify the resulting table design. Datasheet View presents a spreadsheet-style grid, into which data are input and a table is created automatically.

  1. Have the data organized and ready for entry.
  2. Click New on the Tables tab.
  3. Select Datasheet View by double-clicking on the option or by selecting Datasheet View and clicking OK.
  4. Enter data into the datasheet as one might use a spreadsheet.
  5. Save the table, then close the datasheet.
  6. Use Design View to refine the table’s structure.

Create a table using the Table Wizard

The Table Wizard is an ideal tool with which to create tables based upon commonly used designs. Using the Table Wizard, then Design View is often the fastest method for table creation.

  1. Click the Tables tab and then click New.
  2. Select the Table Wizard and click OK.
  3. In the Table Wizard dialog, select a table type and the desired fields, then click Next.
  4. Name the table and select how the primary key is to be set, then click Next.
  5. Select any related tables, as guided by the Table Wizard, then click Next.
  6. Select what to do after the table is designed: input data or refine the design.
  7. Click Finish.

Create a table using Design View

Most experienced Access users prefer to create a table from "scratch" using Design view. The Design View window is split into two panes: the Field Grid pane and the Field Properties pane.

The Field Grid contains four columns, used to structure the table. The columns are:

  • Selector Column: Displays the "Key" icon and the current field indicator. Used to select a row in the design grid.
  • Field Name: The name used by Access to manipulate data within the table.
  • Data Type: See the previous discussion of data types.
  • Description: A description of the field. This description is displayed on the status bar when adding data to the field.

Create a table using the following process:

  1. Click the Tables tab and then click New.
  2. Double-click Design View.
  3. Define each of the fields in the table.
    1. To insert a field within the table, select the row below the new field's destination, then click the Insert Row toolbar icon.
      To add a field at the end of the table, click in the first blank row's Field Name column.
    2. In the Field Name column type the field's name.
    3. In the Data Type column, use the drop-down list to select the data type.
    4. In the Description column, type a description of the field.
    5. Set any properties for the field in the Properties Pane of the window.
  4. Establish a primary key field before saving the table.
    1. Click the field selector for the desired field. Hold CTRL to select several fields for a composite key.
    2. Edit menu, Primary Key
  5. Click the Save icon on the toolbar and enter a name for the table.

Setting general field properties

There are several properties that control the behavior of a field. The basic properties are:

Property Field Types Description
Field Size Text Limits field to a specific number of characters.
New Values AutoNumber Sets how numbers will be generated: incremental or random.
Format Date, Number Specifies a display format for dates or numbers.
Decimal Places Number, Currency Sets the number of decimal places displayed; useful when numbers should be consistent.
Input Mask Text, Date Specifies characters such as parenthesis or dashes to be filled in automatically during data entry.
Caption All The label to be used in forms and reports. Also serves as the column heading in Datasheet View.
Default Value

All

A value automatically entered into new records. Useful when most records have the same value in a field.
Validation Rule All Restricts data entry to within a specific range of values.
Validation Text All The message displayed when input violates the valid range.
Required All Forces a user to input a value into the field.
Allow Zero Length All Allows the user to leave a field blank.
Indexed All Creates an index, which speeds sorts and searches.

To set these properties:

  1. Select the desired field using the field selector column.
  2. Modify the properties...
    1. Directly enter a value for the property.
    2. Select an option from a drop-down list.
    3. Click the Build icon (...) to develop a value or expression.

Special fields – Lookup Wizard data type

One of the reasons to use a database instead of a spreadsheet or another flat-file system is to establish relationships between tables. These relationships are most often established using "lookup" fields.

  1. Create a source table for lookup data
  2. Switch the "dependent" table to Design View
  3. Add or select a field to be the "lookup" link
  4. In Data Type column, select the Lookup Wizard.
  5. When the Lookup Wizard begins, click Next
  6. Select the source table and click Next
  7. Select the field corresponding to the lookup relationship, then click Next
  8. Adjust the lookup drop-down list's display, then click Next
  9. Click Finish

The Lookup Wizard sets the following field properties, which can be found on the Lookup tab of the Field Properties pane:

Display Control Selects the type of control used to present the lookup: Text Box, List Box, or Combo.
Row Source Type Specifies the source of a lookup: table, query, or a list of values.
Row Source The name of the table or query used for the lookup.
Bound Column The number of the column that is displayed from the source table.
Column Count The number of columns displayed in a List Box or Combo control.
Column Heads Display the names of fields in the lookup control, as column headings.
Column Widths Sets the widths of any columns in a drop-down or list box control.

Setting table properties

Tables, just like the fields within, have properties.

  1. Open the table in Design View.
  2. View menu, Properties
  3. Modify the desired property settings in the Table Properties dialog.
  4. Close the dialog.

Working with non-Access tables

Access can work with data created in other programs. These files may be left in their original format or imported. Also, Access can export tables into a format used by another program.

Importing data

Used to convert data from another program into an Access table.

  1. File menu, Get External Data, Import
  2. Using Import Dialog, which is like the standard Open dialog, locate the desired file.
  3. Highlight the file and click Import, or double-click the file's icon.
  4. Follow the Import Wizard, which varies by file type.
  5. Data can be merged into an existing table or a new table created.

Linking to external data

Access can use non-Access tables, which allows the creating application to control data.

  1. File menu, Get External Data, Link Tables
  2. Use Link the dialog to locate the desired file.
  3. Highlight the file and click Link, or double-click the file's icon.
  4. Follow the Link Wizard
  5. Click once on new table's name and then type a new name.
  6. Press ENTER to accept the new table name, which is used only by Access.

Exporting a table

Exporting a table converts the table from Access format to another file format for use by another application.

  1. Select the Tables tab in the Database dialog
  2. Click once on the desired table
  3. File menu, Save As/Export
  4. Select the "To an external file" option and click OK
  5. Use "Save as type" to select the format for the exported data.
    Note: Access selects new file extension.
  6. Click Export

Working with Datasheets

Many Access database tables can be easily edited and maintained in Datasheet View, the default display when one opens a table by double-clicking on its icon. Datasheets appear similar to spreadsheets; working with datasheets is quite comfortable for many users.

Adding records

To add new records, without viewing existing data:

  1. Records menu, Data Entry
  2. Enter new records in the datasheet.
  3. When finished, select Records menu, Remove Filter.

To add a record at the end of the current datasheet:

  1. Press CTRL + {plus sign} or click the New Record icon on the toolbar or datasheet.

Deleting records

  1. Select the desired record.
  2. Press CTRL + {minus sign} or Edit menu, Delete Record.

Resizing rows and columns

  1. Position pointer between rows or columns.
  2. The cursor pointer becomes a two headed arrow.
  3. Hold the mouse button and "drag" to resize cells or double click for a "best fit" for columns.

Altering the column order

Columns (fields) can be reordered without affecting the underlying Table or Query design. The new layout is saved when the datasheet is closed.

  1. Click on the desired column's header.
  2. Drag-and-drop the column at its new location.
  3. Save any changes (prompted at close).

Sorting records

Records can be sorted according to the values in any field, even if the field is not indexed. In this respect Access differs from many other database systems.

  1. Select a field or fields to use for sorting. Fields must be adjacent for a mutli-column sort.
  2. To sort in ascending order (A-Z), click the Sort Ascending toolbar icon or Records menu, Sort, Sort Ascending.
  3. To sort in descending order (Z-A), click the Sort Descending toolbar icon or Records menu, Sort, Sort Descending.

Printing a datasheet

  1. Click the Print toolbar icon while the datasheet is active.

Searching for records

  1. Select the desired field in any record.
  2. Click the Find icon on the toolbar.
  3. Enter value to be located in the "Find what" input box.
  4. Select any desired options for the search.
  5. Click Find First or Find Next
  6. Once finished, click Close.

Quickly filtering data by selection

Quickly limit the displayed records based upon a sample selection:

  1. Select a record containing the desired value in the desired field — called the "example" data.
  2. Click on the example field.
  3. Click the Filter by Selection icon or Records menu, Filter, Filter by Selection.
  4. When finished, select Records menu, Remove Filter.

Filtering by form

Many database users call this procedure a "query by example," or QBE filter. By completing a special form, records meeting complex criteria are filtered. While not as advanced as an Access query, this filtering method is powerful.

  1. Click the Filter by Form icon on the toolbar or Records menu, Filter, Filter by Form.
  2. Select search values using the field drop-down lists.
  3. Click the Or tab to set any other allowed values.
  4. Click the Apply Filter icon or Records menu, Apply Filter / Sort.
  5. When finished, select Records menu, Remove Filter.

Advanced filters and sorting

For a really complex filter, Access offers an "advanced filter" option.

  1. Records menu, Filter, Advanced Filter.
  2. Select fields by double-clicking on field names.
  3. In the filter design grid, select the sort order for each field.
  4. Add any filter criteria expressions.
  5. Click the Apply Filter icon or Records menu, Apply Filter / Sort.
  6. When finished, select Records menu, Remove Filter.

Queries

Query is synonymous with "question" — and in many applications queries are used to analyze data to answer questions such as, "Who purchased these items?" Access queries go beyond simple filters, however. When you build a query, the results are stored in a new "virtual" table. A query table behaves like any other table, making it very powerful.

Create a query

Microsoft Access can create queries in many situations, without the need for a user design.

  • To create a query to use as the basis of a form or report, use the Form or Report Wizards. Wizards create the forms or reports, and if they are based on more than one table, they also create the underlying queries.
  • To create queries that run independently or can be used with multiple forms and reports, run a Query Wizards.
  • To create query tables from filters created using Filter By Form, Filter By Selection, or Filter For Input, save the filter as a query.

Of course, a query can be created or modified in Design View.

Create a simple select query with a wizard

The Simple Select Query Wizard creates queries that retrieve data from the fields in one or more tables or queries. The wizard can sum, count, and average values for groups of records or all records. It can calculate the minimum or maximum value in a field, too.

  1. In the Database window, click the Queries tab, and then click New.
  2. In the New Query dialog box, click Simple Query Wizard and click OK.
  3. Select the table or query for the new query, then select the fields to retrieve.
  4. Select any additional, related tables or queries to construct a more complex query.
  5. Follow the wizard.

Create a select query without a wizard

  1. In the Database window, click the Queries tab, then click New.
  2. In the New Query dialog box, click Design View, then click OK.
  3. In the Show Table dialog box, double-click each object to add to the query, then click Close.
  4. For multiple tables or queries in the new query, connect each with a join line.
  5. Add fields to the query by dragging the field names from the field list to the design grid, or by double-clicking on the field names.
  6. Refine the query with filter criteria, sort orders, calculated fields, or otherwise modifying the query's design.
  7. Click Save on the toolbar. Enter a name, then click OK.

Modifying a query's results

Once designed and saved, a query can be modified at any time in Design View. Most queries need some refinement.

Adding filter criteria

  1. From the Queries tab, select a query and click Design.
  2. In the desired field's Criteria cell, enter a filter value.
  3. Save the query by clicking the save icon.

Sorting records

The new "virtual" table created by a filter can be sorted according to any field in the query.

  1. From the Queries tab, select a query and click Design.
  2. In the desired field's Sort cell, select a sort order.
  3. Because queries sort left-to-right, it might be necessary to move fields using drag-and-drop.
  4. Save the query by clicking the save icon.

Reusable "custom" queries

In some cases, a query can be "recycled" by users. Using user input, a query's criteria can change with every use.

  1. From the Queries tab, select a query and click Design.
  2. In the desired field's Criteria cell, enter a "prompt" enclosed by square brackets, i.e. [state?]
  3. Save and close the query design.
  4. Open the query.
  5. Respond to the prompt and click OK.

Each time the query is used, a "new" result can be generated.

Calculated fields

Unlike tables, queries can include calculated fields. Many database designs require such calculations, such as the total charge for a purchase. These calculated fields can appear on forms and in reports.

  1. From the Queries tab, select a query and click Design.
  2. Click on the first empty "field" cell, appearing at the far right of the grid.
  3. Enter a name and equation:
    FieldName: [tablefield] + equation
    DiscountPrice: [price] * .90
  4. Save the query.

Note: Right-click any field cell to apply formatting via the field properties dialog. Calculated fields may require such formatting.

Crosstab queries

Crosstabs are special queries used primary to report upon the numbers of an item within a table or query.

  1. Create a multi-table query.
  2. From the Queries tab, click New.
  3. Select the Crosstab Query Wizard and click OK.
  4. Select "Queries" from the View options.
  5. Select the desired query and click Next.
  6. Select a row heading and click Next.
  7. Select a field for columns and click Next.
  8. Select a function, usually "Sum," to perform on the tabulation and click Next.
  9. Name the query and click Finish.

Avoiding duplicate query records when printing

Sometimes when printing forms or reports, records appear duplicated. The data are not actually duplicated — this is a result of how query tables are generated.

  1. Open the query that is printing or displaying duplicates.
  2. Right-click in the workspace, then select Properties.
  3. Change the "Unique Values" box to "Yes." This option shows only one detail line per query.
  4. Close the Properties dialog.
  5. Save and close the query.

Relationships

Microsoft Access is a "relational" database management system, or RDBMS. Access tables can be related in several manners:

  • One-to-One: Uncommon; used to secure data in many cases.
  • One-to-Many: Common; simple transactions and relationships.
  • Many-to-Many: Occasionally; items with various sources.
    Requires a third table, known as a "junction."
    Invoices are an example; detail lines have order and part dependencies.

Exploring relationships

Access makes it easy to verify relationships between tables. These relationships are automatically created when a field is defined as a "lookup" field within a table. The Lookup Wizard is the ideal method for establishing such relationships. To verify relationships, use the Relationships Window.

  1. Click the Relationships icon to display the Relationships Window.
  2. Right-click on any blank area of the window.
  3. Select Show Table.
  4. Select Tables, Queries, or both.
  5. Add desired tables to the relationship window by double-clicking their icons or selecting the table name and clicking Add.
  6. Click Close in the Show Table dialog.
  7. Verify any relationships.
  8. Close the Relationships window.

Modifying relationships

  1. Drag and drop a primary key from any master (or "source") table onto a related field in another table. The fields must be of the same type and size.
  2. Right click on any "join" line to modify the relationship.

Many-to-many relationships -- three or more tables

The most complex relationships are many-to-many. An example of a many-to-many relationship at work is an invoice. There are many clients, all stored in one table, and there are many parts, all stored in a table. These two tables are "joined" by an invoice and its "transaction" lines. These relationships are not simple, but invoicing is a common database application.

  1. Create two primary tables, such as clients and parts, and possibly a secondary table, such as an invoice table.
  2. Create a "junction" table, such as an "invoice" table's transaction lines.
    • First two fields are related to primary keys of the primary tables.
    • Select both fields
    • Click primary key icon
  3. Create or verify relationships.
  4. Remember the primary tables are one-to-many, with junction between:
    [P > J < P] or [P > S > J < P]

Consider an invoicing application. When a new invoice is created, one of the fields is a customer key. This field links clients to invoices. A "sub-form" and "secondary" table, possibly called "transactions," contains fields with the invoice number and part number of an item ordered. The transaction table, therefore, links invoices to the parts ordered. It helps to sketch this on paper to understand the relationships. Many clients, many parts, many invoices….

Forms

Most database applications do not allow the user to directly enter information into a table. Instead, databases use forms to control data entry. Forms have several benefits:

  • Better control over user input, with masks and validation.
  • Ease of programming "events" during data entry.
  • Usually based upon queries, to include calculations.

Create a form

Two methods are used in creating forms:

  1. Create a form using the Form Wizard.
  2. Create a form "from scratch."

Any form can be modified in Design View, regardless of creation method.

Creating a form using the Form Wizard

The fastest method of form creation is the Form Wizard. After creating a form using the wizard, it can be easily modified.

  1. Select the Forms tab, click New.
  2. Double-click the Form Wizard option.
  3. From the "Tables/Queries" drop-down list, select the desired table or query
  4. Select any desired fields (double arrows select/unselect all fields) and click Next.
  5. Select a basic form layout, then click Next.
  6. Select a style and click Next.
  7. Title your form and click Finish.

Setting form properties

Once a form is created, set the form properties to "finalize" the design.

  1. Open the form in Design View, if it is not open.
  2. Right-click in the workspace outside the form and select Properties.
  3. Select and modify any form settings.
  4. Close the Properties dialog.
  5. Save the now completed for design.

Create a form based on more than one table

Using a Form Wizard is the simplest and fastest way to create a form that brings data together from more than one table. Use a subform to display data from tables or queries that have a one-to-many or many-to-many relationship.

The main form shows the "one" side of the table relationship and the subform shows the "many" side. Access automatically synchronizes the main form with the subform if both of the following are true:

  • The tables selected have relationships defined or verified in the Relationships window. As long as this underlying table is correctly related to the other underlying table or query, Access synchronizes the form and subform.
  • The main form is based on a table with a primary key and the subform is based on a table that contains a field with the same name as that primary key and with the same or a compatible data type. The Lookup Wizard sets such relationships during table design.

The process to define a multi-table form is as follows:

  1. Create both forms, leaving room on the "main" form for the subform.
  2. Open the main form in Design View.
  3. Bring the database window to the front and select the Forms tab.
  4. Drag-and-drop the subform onto the main form.
  5. Right-click on the subform area of the main form and select Properties.
  6. Click in the "Link Child Fields" box.
  7. Click the "Build" icon (button with ellipses, "...") to modify joins.
  8. Access attempts to determine links.
  9. Click OK.
  10. Save and close the form.

Modifying a form

As with most database objects, designers usually find it necessary to modify forms. These modifications tend to be improvements based upon suggestions from the users of a database application.

Adding controls to a form

  1. Open the form in Design View
  2. Click once on the Toolbox icon for the desired control
  3. Click on the form at the desired location for the control
  4. If the Control Wizard is active follow the wizard's steps

Changing any form control

  1. Right-click on any control, select Properties
  2. Modify desired settings
  3. Close the Properties dialog

Adding an option group

  1. Open form in Design View
  2. On the toolbar, click the Control wizard and then Field List icon
  3. Click the Option Group icon in the Form Design Toolbox
  4. Drag the desired field from the field list onto the form
  5. The Option Group wizard starts
  6. Follow the wizard

Adding a command button

  1. Open the form in Design View
  2. Click the Command Button icon in the Form Control toolbox
  3. Click on the form at the desired location for the button
  4. Follow the wizard

Setting the input tab order of controls

  1. Open the form in Design View
  2. Select View menu, Tab Order
  3. The Tab Order dialog is displayed
  4. Use drag-and-drop to reorder form controls
  5. Click OK when finished
  6. Save the modified form.

Calculated fields on forms

Invoices, inventory systems, and other one-to-many or many-to-many database applications require calculations to be meaningful. For example, an invoice form should display the total amount of transactions on the invoice. The guidelines for calculated fields include:

  • Calculated controls cannot reference other calculated controls.
  • Use queries for basic, single record calculations. Queries are faster than form calculations.
  • Any unbound text box can display the contents of another text box -- allowing a main form to display data from subforms.

Adding a calculated field

  1. Open a subform in Design View.
  2. Increase the area of the footer as required, dragging the bottom border to extend the design grid.
  3. Select the Text Box control from the Form toolbox.
  4. Click in the form's footer area to create the calculated fields.
  5. Click twice in the textbox -- not a double-click!
  6. Type the desired formula, such as =sum{[FieldName]} and press Enter.

Referring to a subform calculated field

  1. Open subform in Design View.
  2. Right-click on the field in the footer and select Properties.
  3. Click the All tab and use the "Name" property to name the field. Keep the name simple to avoid problems working with equations.
  4. Change any other properties as desired.
  5. Close the Properties dialog.
  6. Save and close the subform.
  7. Open the main form in Design View.
  8. Add a textbox to the form.
  9. Right-click on the text box and select Properties.
  10. Click the All tab for the Properties dialog.
  11. In the "Control Source" input box, type a link to the subform in the format: =[SubForm].[Form]![Field]
  12. Change any other properties.
  13. Close the Properties dialog.
  14. Save and close the form.

Display a startup form

In most cases a designer wants a form displayed every time an Access database is opened. This form can be a "switchboard," a form used to navigate a database application, or the form can be the most frequently used data entry form.

  1. On the Tools menu, click Startup.
  2. In the Display Form box, select a form from the current database.
  3. Close the dialog.

Note: To hide the Database window, which appears behind the form, clear the Display Database Window check box.

Changes to these settings in the Startup dialog box do not take effect until the next time the database or application is opened.

Converting a screen form into a report for printing

Screen forms do no print well in most cases. Most database designers modify a screen form and save it in a report format just for printing some data.

  1. In the database dialog, select the Forms tab.
  2. Right-click on the desired form and select Save As Report.
  3. Give the report a name and click OK.
  4. Modify the report as desired.

Reports

Databases are often used to analyze data. Access produces reports with little effort, and these reports can be easily modified.

Creating an AutoReport

  1. Create the desired query (tables are not recommended).
  2. Click the Query tab in the Database dialog.
  3. Select the desired query icon -- do not double-click.
  4. Click the New Object icon on the toolbar and select AutoReport.

Using the Report Wizard

  1. On the Database dialog's Reports tab, click New.
  2. Double-click Report wizard.
  3. Select the desired query (or table).
  4. Select the desired fields, then click Next.
  5. Select any Groupings, then click Next.
  6. Select any Sort options, then click Next.
  7. Select a layout, then click Next.
  8. Select a style (fonts, etc), then click Next.
  9. Name the report and click Finish.

Switchboards

A switchboard is a form with buttons that open forms, reports, or other switchboards. Many Access applications use switchboards to make navigation easier.

Create and manage a switchboard form

The Database Wizard automatically creates a "switchboard" that navigates the database objects. The Switchboard Manager is used to create additional switchboards -- or a main switchboard if the Database Wizard was not used.

Create a switchboard using the Switchboard Manager

To build a switchboard for a database created without the Database Wizard, use the Switchboard Manager.

  1. Tools menu, Add-ins, Switchboard Manager.
  2. If asked, "Create a switchboard?" click Yes.
  3. In the Switchboard Manager dialog, click Edit.
  4. In the Edit Switchboard Page dialog, name the switchboard and click New.
  5. In the Edit Switchboard Item dialog, type text for a switchboard button in the Text property's input box, then click a command from the Command list.
  6. Depending upon the command selected, another box below the Command box might appear. Select an item from this box, if necessary, then click OK.
  7. Repeat this process until all the items are added to the switchboard.
  8. Click Close.

Create a set of switchboards

To have a switchboard branch to another switchboard, choose the Go To Switchboard command in the Command box, then specify the destination switchboard.

Make a change to an existing switchboard

  1. Tools menu, Add-ins, Switchboard Manager.
  2. Click the switchboard you want to edit, and then click Edit.
  3. Click the item on the switchboard you want to change, and then do one of the following:
    • To change the text of the item, the command performed by the item, or the object that's opened or run when you click the button, click Edit.
    • To add an item, click New.
    • To delete an item, click Delete.
    • To move an item, click Move Up or Move Down.
  4. When you've finished changing items, click Close.

Change which switchboard automatically displays

  1. Tools menu, Add-ins, Switchboard Manager.
  2. Select the desired switchboard and click Make Default.

The next time you open your database, Microsoft Access will automatically display the switchboard you specified.