Creating a State Lookup Control on a Web Page
See Also
When you create workflow states, the Workflow Process wizard creates a lookup table called <Tablename>StateLookup to store these states. You can add a state lookup to your data access page to make it easy to select an appropriate state. This is not required if you are using the Workflow Toolbar control, unless you want to make the drop-down list available for display purposes.
To create a list of available states from a lookup column, add the Dropdown List control. The control is bound to the stateID column, which contains an integer used to enforce workflow rules. The value displayed is the name of the state (for example, Active, Resolved, or Closed). When you use a lookup, you can either delete your current stateID column or hide it on the Web page.
To add lookup column support to your Web page using the Dropdown List control
- In Access, open your data access page in Design view, and delete the label for the modStateID column on your page.
- Right-click the ModStateID box, and select Properties.
- On the Format tab, change the value of the Visibility property to hidden, and close the properties window.
- From the Toolbox, drag the Dropdown List control to the form.
- When the wizard appears, accept the I want the combo box to look up the values in the table or view option, and click Next.
- Select the name of the table that contains the workflow lookup information, and click Next. By default, the Workflow Process wizard creates a table called <Tablename>StateLookup.
- Add the state lookup ID and the state name columns to the Selected Fields list box, and click Next.
- Adjust the width of the state lookup ID column, so it is hidden on the Web page. Adjust the state name column as necessary to display the values, and click OK.
- In the Available Fields area, verify that the state lookup ID column is selected as the bound field, and click Next.
Note If you select a single column, this option is not available.
- Change the value of the label from Name to a caption appropriate for your solution, and click Finish.
- Right-click the Dropdown List control, and select Properties.
- On the Data tab, in the ControlSource field, set the value to the column that is storing the state lookup value.
- In the ListBoundField field, ensure the value is set to the name of the state lookup ID column.
Notice the ListDisplayField is set to the name of the column that contains the state name values that will be displayed by the Dropdown List control.
Note If you are using the Workflow Toolbar control, you must have a control bound to the state lookup ID column that is named for the state lookup ID. Be sure to delete your existing text box control, and rename the Dropdown List control to ensure proper functioning of the Workflow Toolbar control. For more information, see Workflow Toolbar Control.