Layout view and Design view are the two views in which you can make design changes to forms. You can use either view to perform many of the same design and layout tasks, but certain tasks are easier to perform in one view than they are in the other. This article describes the similarities and differences between Layout view and Design view, and shows you how to perform some common form design tasks in each view. Show
Note: Although this article is written with forms in mind, many of the concepts also apply to modifying reports. What do you want to do?Understand Layout view and Design viewLayout view Layout view is a more visually-oriented view than Design view. While viewing a form in Layout view, each control displays real data. As a result, this is a very useful view for setting the size of controls, or performing many other tasks that affect the visual appearance and usability of the form. Certain tasks cannot be performed in Layout view and require switching to Design view. In certain situations, Access displays a message telling you that you must switch to Design view to make a particular change. Design view Design view gives you a more detailed view of the structure of the form. You can see the Header, Detail, and Footer sections for the form. You cannot see the underlying data while you are making design changes; however, there are certain tasks you can perform more easily in Design view than in Layout view. You can:
Modify a 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 add new controls to 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 modify 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 the form design. To display the Field List pane, use one of the following methods:
You can then drag fields directly from the Field List pane onto the form.
In this articleDecide how to lay out your reportWhen you design a report, you must first consider how you want the data arranged on the page and how the data is stored in the database. During the design process, you might even discover that the arrangement of data in the tables will not allow you to create the report that you want. This can be an indication that the tables are not normalized — this means that the data is not stored in the most efficient manner. Make a sketch of your reportThis step is not required — you might find that the Access Report Wizard or the Report tool (both of which are available on the Create tab, in the Reports group) provide a sufficient starting design for your report. However, if you decide to design your report without using these tools, you might find it helpful to make a rough sketch of your report on a piece of paper by drawing a box where each field goes and writing the field name in each box. Alternatively, you can use programs such as Word or Visio to create a mockup of the report. Whichever method that you use, be sure to include enough rows to indicate how the data repeats. For example, you can use a row for product information, then several repeating rows for that product's sales, and finally a row of sales totals for the product. Then, the sequence repeats for the next product and so on until the end of the report. Or, perhaps your report is a simple listing of the data in the table, in which case your sketch can contain just a series of rows and columns. Note: This technique is also very useful if you are designing a report for someone else. In this case, the other person can draw the sketch before you begin work. After you create your sketch, determine which table or tables contain the data that you want to display on the report. If all the data is contained in a single table, you can base your report directly on that table. More often, the data that you want is stored in several tables that you must pull together in a query, before you can display it on the report. The query can be embedded in the RecordSource property of the report, or you can create a separate, saved query and base the report on that. Decide which data to put in each report sectionEach report has one or more report sections. The one section that is present in every report is the Detail section. This section repeats once for each record in the table or query that the report is based on. Other sections are optional and repeat less often and are usually used to display information that is common to a group of records, a page of the report, or the entire report. The following table describes where each section is located and how the section is typically used. Section Location Typical contents Report header section Appears only once, at the top of the first page of the report.
Report footer section Appears after the last line of data, above the Page Footer section on the last page of the report. Report totals (sums, counts, averages, and so on) Page header section Appears at the top of each page of the report.
Page footer section Appears at the bottom of each page of the report.
Group header section Appears just preceding of a group of records. The field that is being grouped on Group footer section Appears just after a group of records. Group totals (sums, counts, averages, and so on) For information about adding or removing report header and footer sections or page header and footer sections, see the section in this article. You can add group header and footer sections by using the Group, Sort, and Total pane in Layout view or Design view. Decide how to arrange the detail dataMost reports are arranged in either a tabular or a stacked layout, but Access gives you the flexibility to use just about any arrangement of records and fields that you want. Tabular layout A tabular layout is similar to a spreadsheet. Labels are across the top, and the data is aligned in columns below the labels. Tabular refers to the table-like appearance of the data. This is the type of report that Access creates when you click Report in the Reports group of the Create tab. The tabular layout is a good one to use if your report has a relatively small number of fields that you want to display in a simple list format. The following illustration shows an employee report that was created by using a tabular layout. Stacked layout A stacked layout resembles a form that you fill out when you open a bank account or make a purchase from an online retailer. Each piece of data is labeled, and the fields are stacked on top of each other. This layout is good for reports that contain too many fields to display in a tabular format — that is, the width of the columns would exceed the width of the report. The following illustration shows an employee report that was created by using a stacked layout. Note: In the Report Wizard, this layout is referred to as a columnar layout. Mixed layout You can mix elements of tabular and stacked layouts. For example, for each record, you can arrange some of the fields in a horizontal row at the top of the Detail section and arrange other fields from the same record in one or more stacked layouts beneath the top row. The following illustration shows an employee report that was created by using a mixed layout. The ID, Last Name, and First Name fields are arranged in a tabular control layout, and the Job Title and Business Phone fields are arranged in a stacked layout. In this example, gridlines are used to provide a visual separation of fields for each employee. Justified layout If you use the Report Wizard to create your report, you can choose to use a justified layout. This layout uses the full width of the page to display the records as compactly as possible. Of course, you can achieve the same results without using the Report Wizard, but it can be a painstaking process to align the fields exactly. The following illustration shows an employee report that was created by using the Report Wizard's justified layout. The justified layout is a good layout to use if you are displaying a large number of fields on the report. In the preceding example, if you use a tabular layout to display the same data, the fields extend off the edge of the page. If you use a stacked layout, each record takes up much more vertical space, which wastes paper and makes the report more difficult to read. Use control layouts to align your dataControl layouts are guides that you can add to a report while it is open in Layout view or Design view. Access adds control layouts automatically when you use the Report Wizard to build a report, or when you create a report by clicking Report in the Reports group of the Create tab. A control layout is like a table, each cell of which can contain a label, a text box, or any other type of control. The following illustration shows a tabular control layout on a report. The orange lines indicate the rows and columns of the control layout, and they are visible only when the report is open in Layout view or Design view. Control layouts help you achieve a uniform alignment of data in rows and columns, and they make it easier to add, resize, or remove fields. By using the tools in the Table and Position groups on the Arrange tab (available in Layout view or Design view), you can change one type of control layout to another, and you can remove controls from layouts so that you can position the controls wherever you want on the report. Add or remove report or page header and footer sectionsAs mentioned earlier in this article, headers and footers are report sections that you can use to display information that is common to the entire report, or to each page of a report. For example, you can add a Page Footer section to display a page number at the bottom of each page, or you can add a Report Header section to display a title for the entire report. Add report or page header and footer sections
Access always adds page and report header and footer sections in pairs. That is, you cannot add a page or report header section without also adding the corresponding footer section. If you do not need both sections, you cannot delete a section, but you can resize the unused section to a height of zero (0) to avoid adding extra vertical spacing to your report. Position the pointer at the bottom of the unused section until it turns into a double-headed arrow Remove report or page header and footer sections
If you are removing a header and footer pair and those sections contain controls, Access warns you that deleting the sections will also delete the controls and that you will not be able to undo the action. Click Yes to remove the sections and delete the controls, or click No to cancel the operation. Tips for formatting different data typesWhen you create a report by using the Report tool (available on the Create tab, in the Reports group), or by using the Report Wizard, Access adds the fields to the report for you and creates the most appropriate control to display each field, based on the field's data type. If you are adding fields to a report yourself, the preferred method is to drag each field from the Field List to the report. As with the Report Wizard or the Report tool, Access creates the most appropriate control for each field, depending on the field's data type. For most data types, the most appropriate (default) control to use is the text box. The following sections provide tips about how to format some of the special case data types. Multivalued fields The default control for a multivalued field is a combo box. This can seem like a strange choice for a control on a report, because you can't click the arrow on a combo box in a report. However, in the context of a report, a combo box behaves like a text box. The arrow is visible only in Design view. If the field contains multiple values, those values are separated by commas. If the combo box is not wide enough to display all the values on one line and the CanGrow property of the combo box is set to Yes, the values wrap to the next line. Otherwise, the values are truncated. To set the CanGrow property for a control, open the report in Design view or Layout view, click the control, and then press F4 to display the control's property sheet. The CanGrow property is located on both the Format tab and the All tab of the property sheet for the control. Rich text fields The default control for a rich text field is a text box. If the text box is not wide enough to display all the values on one line and the CanGrow property of the text box is set to Yes, the values wrap to the next line. Otherwise, the values are truncated. To set the CanGrow property for a control, open the report in Design view or Layout view, click the control, and then press F4 to display the control's property sheet. The CanGrow property is located on both the Format tab and the All tab of the property sheet for the control. A rich text field helps you to format text in a variety of ways. For example, several words in a field can be underlined, and several other words in the same field can be in italic. You can, however, still set an overall formatting style for the text box that contains the rich text. The text box formatting applies only to the text that has not been specifically formatted by using rich text formatting. Set formatting styles for a text box that displays a rich text field
Set the display properties for an Attachment field
|