Scripting with the Workflow Toolbar

See Also

Script can be used to customize your team solution. For example, by default, the Workflow Toolbar control ensures users set the workflow action before they can edit the fields and save the record. If you want to make it possible for fields to be edited before the workflow action is set, you can program the update to the recordset to be done in the event script. Or, in another example, if the toolbar control is located on a summary data access page showing multiple rows, you can use an event to navigate to a detail page for data entry.

To add script to the Workflow Toolbar control

  1. In Access, open a data access page in Design view.

  2. Right-click the Workflow Toolbar control, and select Microsoft Script Editor.

  3. If the Script Outline tab is not displayed, select the View menu, and choose Other Windows, and then choose Script Outline.

  4. On the Script Outline tab, expand the Workflow Toolbar node to see the ClickAction and ClickOffline events.

    Note   By default, the Workflow Toolbar control is named ActiveXCtl0. If you have not changed the name using the (ID) property, this object appears at the top of the Client Objects & Events node.

  5. When you double-click the event, the appropriate syntax is added to the data access page directly above the </HEAD> tag.

Example of ClickAction and ClickOffline script handlers for a data access page

<SCRIPT event=ClickAction for=ActiveXCtl0 language=vbscript>
<!--
   'code goes here
-->
</SCRIPT>

<SCRIPT event=ClickOffline for=ActiveXCtl0 language=vbscript>
<!--
   'code goes here
-->
</SCRIPT>
</HEAD>