Change the record source or connection information

Microsoft Office Access 2003

After you have created a form or report, you can modify its source of data to include or exclude one or more fields, columns, tables, or queries. Changing the record source will change the contents of the field list.

  1. Open the form or report in Design view.
  2. Double-click the form selector or the report selector to open the property sheet.
  3. Do one of the following:
    • To include all fields or columns from a single table or query in the record source, click the arrow in the RecordSource property box to select from a list of tables and queries.
    • To base the form or report on certain fields or columns, or on more than one table or query, click the Build button Button image next to the RecordSource property to open the query.

ShowChange the connection information of a data access page

  1. Open the data access page in Design view.
  2. On the Edit menu, click Select Page.
  3. On the property sheet, click the Data tab.
  4. Do one of the following:

    ShowSet or edit the ConnectionString property of the page

    Note  Editing the ConnectionString property of a page that is linked to a connection file will break the link between the page and the connection file.

    • In the ConnectionString property box, either type the new connection string or click the Build button Button image to use the Data Link Properties dialog box to build the connection string.

    ShowTip

    If you need more room to type the connection string, press SHIFT+F2 to open the Zoom box.

    ShowSpecify or change the connection file that the page is linked to

    • In the ConnectionFile property box, either type the name of the new connection file or click the Build button Button image to locate the file.

    Note  Microsoft Access will automatically update the ConnectionString property to reflect the new connection information.

    ShowEdit the connection file of the page

    Note  If the page is linked to a connection file, you can edit the contents of the file. Your edits will affect other pages that are linked to the connection file.

    1. In the ConnectionFile property box, click the Build button Button image.
    2. In the Select Data Source dialog box, right-click the connection file, point to Open With, and click Notepad.
    3. Search for "<odc:ConnectionString>" (without the quotation marks) to locate the connection information and make the changes you want.
    4. Save and close the file.
    5. In the Select Data Source dialog box, click OK.

Notes

  • If you have specified a default connection file on the Pages tab in the Options dialog box, Microsoft Access will automatically set the ConnectionFile and ConnectionString properties for all new data access pages.

  • This procedure doesn't apply to a Microsoft Office PivotTable Component, Spreadsheet Component, or Chart Component. For more information about a PivotTable list, spreadsheet, or chart, click Help Button image on that component's toolbar.

ShowChange the record source of a data access page section

You can change the record source of a section on an ungrouped page, if the record source that you want to use contains all the fields that are already on the header section. For example, if you add fields from the Order Details table, and then decide to use the Order Details Extended query instead of the Order Details table, you can simply change the property of the header section.

  1. Open the data access page in Design view.
  2. Double-click the section bar of the header section.
  3. In the RecordSource property box, select a record source from the list.

Note  The names of the sections and the ControlSource property of the controls will be automatically updated to reflect the new record source.