CreateRecord Data Block (Access custom web app)

Office 2013 and later

You can use the CreateRecord data block to create a new record in the specified table.

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 CreateRecord data block is available only in Data Macros.

The CreateRecord data block has the following arguments.

The CreateRecord data block has the following arguments.

Argument name

Required

Description

Create a Record In

Yes

The name of the table to create the new record in.

Alias

No

A string that identifies the record. You can use the record's alias to identify

The record created by CreateRecord automatically becomes the current record.

After CreateRecord statement, you can insert a block of commands that will execute before the new record is committed. The following actions are available in a CreateRecord data block.

After the CreateRecord action creates a record, use the SetField action to specify a value of a field in the new record.

You can use an If...Then...Else statement to perform operations based on a condition.

To cancel the creation of a record, use the CancelRecordChange action. This prevents the changes from being committed and exits the CreateRecord data block.

Once the new record is committed, you can use the LastCreateRecordIdentity local variable to work with the record. For example, use the following syntax to refer to the AssignedTo field of the most recently created record.

[LastCreateRecordIdentity].[AssignedTo]
Show: