Skip to content
Tutorials Center
My learning

Topics

Lesson 15 of 36 ยท Forms and Reports

Creating Forms in Access: Wizards, Views and Record Sources

Build Access forms with the Form button, Form Wizard, Split Form and Multiple Items. Learn Form, Layout and Design views, the Record Source, navigation and data entry settings.

You can type data straight into a table datasheet, but a datasheet shows every field at once, offers no guidance and lets users change things they should not touch. A form is a friendlier window onto your data. It can show one record at a time, group fields sensibly, offer drop-downs, validate input, calculate totals and hide the plumbing.

This lesson covers the quickest ways to create forms, what each form view is for, how a form is tied to its data through a Record Source and the form properties that control data entry. The next lesson goes deeper into controls and subforms.

How a form works

A form has three ingredients:

  1. A Record Source: a table or query that supplies the rows.
  2. Controls: text boxes, combo boxes, check boxes, buttons and labels placed on the form.
  3. Bound links: each control has a Control Source, the field it displays and edits. A control bound to a field writes changes back to the table.

Controls that are not tied to a field are unbound: a heading label, a button or a calculation box.

Anatomy of a form

Record Source The table or query behind it
Controls Boxes, buttons, labels
Control Source Binds a control to a field

Change data in the form and the table changes.

1 / 2

Creating a form quickly

  1. In the Navigation Pane, select a table or query. Do not open it.
  2. Choose Create > Form.

Access builds a form with a label and a text box for every field and opens it in Layout view. If the table has related child tables, Access adds a subform with those records below. You can delete it if you do not want it.

Other buttons in the Forms group on the Create tab:

  • Form Design opens a blank form in Design view. You add the controls yourself.
  • Blank Form opens a blank form in Layout view with a Field List pane you drag fields from.
  • Form Wizard asks which fields to include, which layout (Columnar, Tabular, Datasheet or Justified) and the form title.
  • More Forms offers Multiple Items (a tabular list that you can still format), Datasheet, Split Form (a datasheet on top and the single-record form below) and Modal Dialog (a pop-up that must be closed before returning).
  • Navigation Form builds a tabbed home screen to open other forms.

The Form Wizard is useful when you want fields from several tables: choose a table, add some fields, change the table in the dropdown and add more. Access creates a query behind the scenes.

The form views

View What you do there
Form view Use the form: browse, edit and add records.
Layout view Adjust the design with live data showing. Move and resize controls as groups, change fonts and colors. Best for most changes.
Design view Full control: add controls from the Controls gallery, set properties and edit sections. Needed for code events, precise placement and form headers and footers.
Datasheet view Shows the form's records as a grid.

Switch with Home > View or the status bar buttons. A good workflow is: create the form, refine in Layout view, finish in Design view.

Form sections

In Design view a form has three sections: the Form Header, the Detail area (repeated for each record in continuous forms) and the Form Footer. Headers and footers appear once. Right-click the form body and choose Form Header/Footer to add them. The Detail section holds the field controls.

The Record Source

Open the Property Sheet (F4), choose Form in the dropdown at the top and click the Data tab. Record Source names the table or query. Click the ... button to build a query in Design view, and make the form use a query instead of a table when you need joins, sorting or a filter:

SQL
SELECT Customers.CustomerID, Customers.CustomerName, Customers.City
FROM Customers
WHERE Customers.Active = True
ORDER BY Customers.CustomerName;

A form built on a query is flexible. The query can join several tables to show a customer's name next to each order, or sort the form by last name. If the query is updatable, edits flow back to the tables.

The query behind a form is just a select. This runnable example shows the kind of query you would set as the Record Source for an orders form, with the customer name looked up through a join:

SQL A Record Source query for an orders form

Press Run (or Ctrl + Enter) to see the result here.

At the bottom of a form is the record navigator: first, previous, current record number, next, last and new (blank) record buttons, a No Filter indicator and a Search box. Useful shortcuts:

  • Page Down / Page Up move to the next or previous record.
  • Ctrl+Page Down and Ctrl+Page Up also work in continuous forms.
  • F5 goes to the record-number box.
  • Ctrl+F opens Find and Replace. Ctrl+H is Replace.
  • Ctrl++ (Ctrl and plus) starts a new record.
  • Ctrl+- deletes the current record.

Sorting and filtering are on the Home tab: the Ascending, Descending buttons, Selection (filter by the value in the current control) and Advanced (filter by form).

Properties that control data entry

On the Data tab of the form's Property Sheet:

Property Effect
Allow Edits If No, users can view but not change existing records.
Allow Additions If No, users cannot add new records.
Allow Deletions If No, the delete command is blocked.
Data Entry If Yes, the form always opens at a blank new record and cannot show existing ones. Useful for "add new" forms.
Filter, Order By A saved filter and sort applied when the form opens.
Record Locks No Locks (optimistic), All Records or Edited Record, for multi-user control.

On the Format tab:

Property Effect
Default View Single Form, Continuous Forms or Datasheet.
Navigation Buttons Show or hide the record navigator.
Scroll Bars, Record Selectors Interface touches.
Dividing Lines Lines between sections.
Auto Center, Border Style Window appearance for pop-ups.

Also useful: Pop Up and Modal (for dialog forms) and Caption (the text in the tab).

Setting the startup form

To open a form automatically whenever the database opens, choose File > Options > Current Database, and under Application Options set Display Form to your form. Combine with unticking Display Navigation Pane if you want users to stay on the form. Holding Shift while opening the file bypasses the startup options, so do not rely on this as security.

Saving and naming

Press Ctrl+S and name the form. A convention many people follow is a frm prefix (frmCustomers), and for subforms sfrm (sfrmOrders). This is optional but keeps the Navigation Pane readable once you have dozens of forms.

Tips for good forms

  • Group related fields together and keep a logical tab order. Use Design > Tab Order (or the Property Sheet's Tab Stop and Tab Index).
  • Lock calculated and key fields by setting Locked = Yes or Enabled = No, so users cannot edit an AutoNumber.
  • Use combo boxes for fields that must hold a value from another table.
  • Leave white space. A crowded form is hard to scan.
  • Test with real data and with a blank new record.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What do you set to make a form show only records from a join of several tables?

    A form's Record Source can be a saved or embedded query. That query can join, filter and sort the data the form displays.
  2. 2. Which view is best for resizing controls while seeing live data?

    Layout view shows real records while you adjust the layout, which makes sizing and alignment easy.
  3. 3. What does setting Data Entry to Yes do?

    With Data Entry = Yes the form is for adding new records only; existing records are not displayed.
  4. 4. What is a bound control?

    A bound control displays and edits a field's value; an unbound control is not tied to data.

Summary

  • A form shows and edits data from a Record Source (a table or query) through bound controls.
  • Create forms quickly with Create > Form, the Form Wizard, Split Form or Multiple Items; refine them in Layout view and Design view.
  • Use a query as the Record Source to join, sort and filter.
  • Form properties such as Allow Edits, Allow Additions and Data Entry control what users may do.
  • Set a startup form in File > Options > Current Database, and name forms clearly.

Next: Form Controls, Subforms and Properties