Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
A ForEachRecord data block repeats a set of statements for each record in a domain.
Important
Microsoft no longer recommends creating and using Access web apps in SharePoint. As an alternative, consider using Microsoft PowerApps to build no-code business solutions for the web and mobile devices.
Note
The ForEachRecord data block is available only in Data Macros.
Setting
The ForEachRecord action has the following arguments.
| Argument name | Required | Description |
|---|---|---|
| In |
Yes |
A string that identifies the domain of records to operate on. The In argument can contain the name of the table, a select query, or a SQL statement. NOTE: The specified domain cannot include data stored in a linked table or ODBC data source. |
| Where Condition |
No |
A string expression used to restrict the range of data on which the ForEachRecord data block is performed. For example, criteria is often equivalent to the WHERE clause in an SQL expression, without the word WHERE. If criteria are omitted, the ForEachRecord data block operates on the entire domain specified by the In argument. Any field that is included in criteria must also be a field in In. |
| Alias |
No |
A string that provides an alternative name for the domain specified by the In argument. Often used to shorten the table name for subsequent references to prevent possible ambiguous references. If Alias is not specified, the table or query name will be used as the alias. |
Remarks
Use the ExitForEachRecord action to exit a ForEachRecord data block immediately.