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.
You can use the EditRecord data block to change the values contained in an existing record.
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 EditRecord data block is available only in Data Macros.
Setting
The EditRecord data block has the following arguments.
| Argument | Description |
|---|---|
| Alias |
A string that identifies the record to edit. If the Alias argument is not specified, then the current record is edited. |
Remarks
After the EditRecord statement, you can insert a block of commands that will execute before the changes to the record are committed. The following actions are available in an EditRecord data block.
| Action |
|---|
| CancelRecordChange Macro Action |
| Comment Macro Statement |
| Group Macro Statement |
| If...Then...Else Macro Statement |
| SetField Macro Action |
| SetLocalVar Macro Action |
Use the SetField action to specify the new values of a field in the edited record.
You can use an If...Then...Else statement to perform operations based on a condition.
To cancel the editing of a record, use the CancelRecordChange action. This prevents the changes from being committed and exits the EditRecord data block.
You can use the LastCreateRecordIdentity local variable to work with last record created in a CreateRecord data block. For example, use the following syntax to refer to the AssignedTo field of the most recently created record:
[LastCreateRecordIdentity].[AssignedTo]