ForEachRecord Data Block (Access custom web app)

Office 2013 and later

A ForEachRecord data block repeats a set of statements for each record in a domain.

Last modified: March 09, 2015

Applies to: Access 2013 | Access 2016

Important note 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 Note

The ForEachRecord data block is available only in Data Macros.

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 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.

Use the ExitForEachRecord action to exit a ForEachRecord data block immediately.

Show: