About adding data to a data access page by using the field list

About adding data to a data access page by using the field list

When you use the field list to add data to your data access page, Microsoft Access automatically creates controls that are bound to the fields you add, just like it does with the form and report field list. However, the form and report field list and the data access page field list are not the same. Before you can add bound controls to a form or report, you must first bind the form or report to a specific record source. Once you do that, only the fields from that record source are displayed in the field list. A data access page, on the other hand, isn't bound until you add controls to it, and then it can be bound to more than one record source at a time. Therefore, the field list for a data access page displays all the fields you can choose from in the database to add to the page.

This topic provides reference information about what you need to do to use the field list and what the field list contains, what Access does for you when you use the field list, and how you add fields to the data access page. Before you begin, familiarize yourself with the strategies for creating a data access page.

You connect to a database

Access identifies related fields

You can add individual controls for each field

You can add a PivotTable control with multiple fields

Access builds the SQL query for the data access page

Access builds the data access page's data definition

You connect to a database

Before you can add data to a data access page, you must be connected to a Microsoft Access database or Microsoft SQL Server database. When the page is connected to one of these databases, the Database tab in the field list displays folders containing all of the tables or queries available in the database. If the database icon in the field list has a red X on it and you don’t see any folders underneath it, you need to connect the data access page to a database to continue designing the page.

Return to top

Access identifies related fields

In the field list, when you click the expand indicator next to a specific table or query, you’ll see the list of fields for that record source. If the record source is a table, you'll see a Related Tables folder above the list of fields. The folder lists the tables and fields that are related to the table you expanded in the field list. If you hold the pointer over a table in the Related Tables folder, you'll see the field through which the tables are related. If you add fields directly from tables that are related, or if you add fields from queries that use related tables, Microsoft Access automatically uses the existing relationships as you design the data access page. If you add fields to the page from tables that aren't related or from tables that have multiple relationships to tables already used on the page, Microsoft Access will prompt you each time to define a new relationship. Relationships you define in this way are only used for the current data access page; they are not added to the database.

Field list

Note   If you're working in a multiuser environment, you may want to refresh the field list occasionally in case others have added tables or queries since you began designing the data access page.

Return to top

You can add individual controls for each field

You can drag fields one at a time to the data access page to create a control bound to that field. Or you can drag an entire table or other record source from the field list to add all of its fields at one time. If the Control Wizards tool in the toolbox is selected, when you drag an entire table to a section, Microsoft Access displays the Layout Wizard, which asks whether you want to add fields as individual controls or as a PivotTable list. If you want users to be able to edit the data in the fields, or if you want to arrange the controls in a free-form custom layout, use individual controls. With a few exceptions, Microsoft Access automatically creates the appropriate kind of individual control based on the type of data stored in the field. You can also choose the kind of individual control you want it to create before you drag the field to the data access page.

Return to top

You can add a PivotTable control with multiple fields

Add fields as part of a PivotTable control if you want to display data that you can rearrange, summarize, and otherwise analyze in different ways, but not add or change the actual values. Learn more about what a PivotTable list is and what it can do before you decide. Or you can use PivotTable lists just to display data in a grid, such as detail records in a grouped data access page. When you use a PivotTable control in this way, you can set properties that hide the pivoting functionality. If you create a PivotTable list by dragging a table or other record source from the field list and then choosing PivotTable list, some of these properties are already set to hide certain PivotTable list features, such as the title bar, toolbar, and column and row drop areas. Use the PivotTable Property Toolbox to change these and other properties of the control and its content.

Note   A PivotTable list control has its own field list separate from the field list for the data access page. The PivotTable field list shows all of the fields you added from the data access page's field list to the PivotTable control. It does not list all of the fields and record sources available in the database. If you remove a field from the PivotTable list control, the field remains in the PivotTable's field list so you can add it at a later time. Unlike the data access page's field list, the PivotTable field list is also available in the browser so others using the page can add fields to the PivotTable list as they're analyzing data.

Return to top

Access builds the SQL query for the data access page

As you drag fields and record sources to the data access page and add grouping levels, sort orders, and so on, Microsoft Access constructs a query behind the scenes that translates what you've laid out on the screen and otherwise specified for the design into Structured Query Language (SQL) that the database understands. Using the existing relationships that are defined between record sources, Microsoft Access creates a query that retrieves the data you selected and presents it the way you've specified. If you add fields from record sources that have no relationship, Microsoft Access displays the New Relationship dialog box so you can define the relationship yourself.

Return to top

Access builds the data access page's data definition

When you add a field to the data access page, Access also adds the field to the page's data definition, which is the collection of data you've added to the page. The data definition, represented on the Page tab in the field list, shows which record sources are used for the page, how the data is related, and what the grouping levels are.

Return to top

More information

Where the data comes from for a data access page