Share via


Workflow Toolbar Features

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

The Microsoft® Office Developer Workflow Toolbar control makes it quick and easy to create a data access page that can work with your application. It adds a menu bar to the user interface that displays all available workflow events.

At run time, the toolbar control adds buttons for each uniquely named OnCreate, OnChange, and OnDelete event in the workflow process. Based on the value of the modStateID column in the current data row, the toolbar control makes buttons available or unavailable to reflect the events that are available in that state. The toolbar control only creates the buttons if the ShowActionButtons property is True. Otherwise, it does not do any workflow related processing.

By default, the toolbar control expects users to select an event, perform whatever data entry is required, and then save the record. Therefore, it makes all other text-editing controls on the data access page and all other elements in the section to which it is bound unavailable until the user clicks an event. Then, the elements are enabled to make it possible for the user to enter data. The LockFieldsBeforeEdit property can be set to False to stop the toolbar from disabling data-bound elements.

For the toolbar to display the workflow events on the data access page, the UniqueTable property must be set to the base table that contains the workflow. In addition, a field bound to the modStateID column must be included on the data access page in either the first section or the section specified in the toolbar's RecordSource property. This field can be hidden.

Note   If you alter the UniqueTable property of the data access page after adding the toolbar control to the page, the control will not pick up the new setting automatically. The UniqueTable property is selected when the control loads, so you must close and reopen the designer, or you must switch between page and design view, before the toolbar picks up the change.

When a user clicks an event button in the toolbar, the control fires a ClickAction event. Client script can be attached to this event to implement custom behavior for the toolbar buttons.

After the event is fired, the action performed by the toolbar control depends on the type of workflow event.

Workflow event Toolbar control action
OnChange Sets the modStateID value to the next state and enables all data-bound controls.
OnCreate Inserts a new record, sets the row position to that record, sets the modStateID value to the first state, and enables all data-bound controls.
OnDelete Deletes the current record.

The toolbar control provides a CancelEvent method that can be called during the Click event process to stop the toolbar control from performing the Update, Insert, or Delete actions if you want to implement custom behavior instead.

See Also

SQL Server Workflow Toolbar Control | Workflow Toolbar Object Model | Scripting with the Workflow Toolbar | Distributing the Toolbar with an Application