A form in Access is a database object that you can use to create a user interface for a database application. A "bound" form is one that is directly connected to a data source such as a table or query, and can be used to enter, edit, or display data from that data source. Alternatively, you can create an "unbound" form that does not link directly to a data source, but which still contains command buttons, labels, or other controls that you need to operate your application. Show
This article focuses primarily on bound forms. You can use bound forms to control access to data, such as which fields or rows of data are displayed. For example, certain users might need to see only several fields in a table with many fields. Providing those users with a form that contains only those fields makes it easier for them to use the database. You can also add command buttons and other features to a form to automate frequently performed actions. Think of bound forms as windows through which people see and reach your database. An effective form speeds the use of your database, because people don't have to search for what they need. A visually attractive form makes working with the database more pleasant and more efficient, and it can also help prevent incorrect data from being entered. Note: This article assumes you have already created a table (or a query based on one or more tables), and that you want to build a form to view or manipulate the data. In this articleCreate a form by using the Form toolYou can use the Form tool to create a form with a single mouse-click. When you use this tool, all the fields from the underlying data source are placed on the form. You can start using the new form immediately, or you can modify it in Layout view or Design view to better suit your needs. Use the Form tool to create a new form
Access creates the form and displays it in Layout view. In Layout view, you can make design changes to the form while it is displaying data. For example, you can adjust the size of the text boxes to fit the data, if necessary. If Access finds a single table that has a one-to-many relationship with the table or query that you used to create the form, Access adds a datasheet to the form that is based on the related table or query. For example, if you create a simple form that is based on the Employees table, and there is a one-to-many relationship that is defined between the Employees table and Orders table, the datasheet displays all the records in the Orders table that relate to the current Employee record. You can delete the datasheet from the form if you decide you do not need it. If there is more than one table with a one-to-many relationship to the table that you used to create the form, Access does not add any datasheets to the form. Create a split form by using the Split Form toolA split form gives you two views of the data at the same time — a Form view and a Datasheet view. A split form differs from a form/subform combination in that the two views are connected to the same data source and are synchronized with one another at all times. Selecting a field in one part of the form selects the same field in the other part of the form. You can add, edit, or delete data from either part (as long as the record source is updatable, and you have not configured the form to prevent these actions). Working with split forms gives you the benefits of both kinds of forms in a single form. For example, you can use the datasheet portion of the form to quickly locate a record, and then use the form portion to view or edit the record. To create a split form by using the Split Form tool:
Access creates the form and displays it in Layout view. In Layout view, you can make design changes to the form while it is displaying data. For example, you can adjust the size of the text boxes to fit the data, if necessary. For more information about form views, see the section. Create a form that displays multiple records by using the Multiple Items toolWhen you create a form by using the Form tool, the form that Access creates displays a single record at a time. If you want a form that displays multiple records but is more customizable than a datasheet, you can use the Multiple Items tool.
Access creates the form and displays it in Layout view. In Layout view, you can make design changes to the form while it is displaying data. When you use the Multiple Items tool, the form that Access creates resembles a datasheet. The data is arranged in rows and columns, and you see more than one record at a time. However, a Multiple Items form gives you more customization options than a datasheet, such as the ability to add graphical elements, buttons, and other controls. For more information about customizing your form, see the sections and . Create a form by using the Form WizardTo be more selective about what fields appear on your form, you can use the Form Wizard instead of the various form-building tools previously mentioned. You can also define how the data is grouped and sorted, and you can use fields from more than one table or query, as long as you specified the relationships between the tables and queries beforehand.
Create a form by using the Blank Form toolIf the wizard or the form-building tools don't meet your needs, you can use the Blank Form tool to build a form. This can be a very quick way to build a form, especially if you plan to put only a few fields on your form.
Understand Layout view and Design viewLayout view Layout view is the most intuitive view to use for form modification, and it can be used for almost all the changes that you would want to make to a form in Access. In Layout view, the form is actually running. Therefore, you can see your data much as it will appear when you are using the form. However, you can also change the form design in this view. Because you can see the data while you are modifying the form, this is a very useful view for setting the size of controls or performing almost any other task that affects the appearance and usability of the form. If you encounter a task that cannot be performed in Layout view, you can switch to Design view. In certain situations, Access displays a message that states that you must switch to Design view before you can make a particular change. Design view Design view gives you a more detailed view of the structure of your form. You can see the Header, Detail, and Footer sections for the form. The form is not actually running when it is shown in Design view. Therefore, you cannot see the underlying data while you are making design changes. However, there are certain tasks that you can perform more easily in Design view than in Layout view. You can:
Fine-tune your form in Layout viewAfter you create a form, you can easily fine-tune its design by working in Layout view. Using the actual form data as your guide, you can rearrange the controls and adjust their sizes. You can place new controls on the form and set the properties for the form and its controls. To switch to Layout view, right-click the form name in the Navigation Pane and then click Layout View. Access shows the form in Layout view. You can use the property sheet to change the properties for the form and its controls and sections. To display the property sheet, press F4. You can use the Field List pane to add fields from the underlying table or query to your form design. To display the Field List pane:
You can then drag fields directly from the Field List pane onto your form.
|