View, modify, or copy a query's SQL statement (MDB)

Microsoft Office Access 2003

Show All Show All

View, modify, or copy a query's SQL statement (MDB)

Note  The information in this topic applies only to a Microsoft Access database (.mdb).

If you're familiar with SQL, you might want to work directly with a query's underlying SQL statement. Or, you might want to copy the SQL statement and paste it elsewhere, such as in the RowSource property of a list box in a form or report.

  1. Open the query you want to work with.
  2. Click the arrow next to View Button image on the toolbar, and then click SQL View.

    Microsoft Access displays the SQL statement that is equivalent to what you created in Design view.

  3. Do one or more of the following:

    To modify the SQL, type your changes in the SQL statement.

    To copy the SQL, select all or part of the SQL statement, copy the selected text, and paste the SQL statement in, for example, a property box or the Microsoft Visual Basic Editor.

  4. To see the changes in the design grid, click the arrow next to the View button on the toolbar, and then click Design View.