OutputAllFields Property

Applies To

Action query, Parameter query, Select query.

Description

You can use the OutputAllFields property to show all fields in the query's underlying data source and in the field list of a form or report. Setting this property is an easy way to show all fields without having to click the Show box in the query design grid for each field in the query.

Note The OutputAllFields property applies only to append, make-table, and select queries.

Setting

The OutputAllFields property uses the following settings.

Setting

Description

Yes

Displays all the fields in the underlying tables and in the field list of a form or report.

No

(Default) Displays only fields that have the Show box selected in the query design grid.


You can set this property only by using the query's property sheet.

Note The use of an asterisk (*) in an SQL statement in place of a field name is the equivalent of setting the OutputAllFields property to Yes.

Remarks

When the OutputAllFields property is set to Yes, the only fields you need to include in the query design grid are those that you want to sort on or specify criteria for.

When you save a filter as a query, Microsoft Access sets the OutputAllFields property to Yes.

Example

The following example uses an asterisk in an SQL statement to select all the fields in the Shippers table. It then displays the fields in text boxes on a form by setting the ControlSource property for the text boxes to the names of the individual fields in the query.

Dim strGetSQL AS String
strGetSQL = "SELECT * FROM Shippers"
Forms!Form1.RecordSource = strGetSQL
Text1.ControlSource = "ShipperID"
Text2.ControlSource = "CompanyName"
In the output for the next SQL statement, the values in the CompanyName and ProductName fields are sorted in ascending order, and all the fields in the Suppliers and Products tables are displayed in the field lists and in Datasheet view. You enter this SQL statement in SQL view of the Query window.

SELECT * FROM Suppliers INNER JOIN Products
ON Suppliers.[SupplierID] = Products.[SupplierID]
ORDER BY Suppliers.[CompanyName], Products.[ProductName];