If you create a Select script for a table that calls a stored procedure, you may have to prompt the user for the value of a parameter to pass to the procedure. This method allows you to do that. It's similar to GetValuesForParameter, except the parameter is associated with a field; that is, it displays the caption for the field and the user can click the Values button (if allowed for that field) to see a list of the distinct values available.

Syntax

GetValuesForField(FieldName as String, Operator as String
    [, Values as Collection]) as Object

Parameters
FieldName
The name of the field (aliased with the table name) to get the value for.

Operator
The operator to use; one of the following:

  • equals
  • not equals
  • is not equal
  • begins with
  • not begins with
  • does not begin with
  • contains
  • not contains
  • does not contain
  • greater than
  • is greater than
  • greater than or equal
  • is greater than or equal
  • less than
  • is less than
  • less than or equal
  • is less than or equal
  • between
  • is between
  • not between
  • is not between
  • not is between
  • is one of
  • is not one of
  • not is one of
  • is blank
  • is not blank
  • not is blank
  • is known
  • is unknown
  • is yes
  • is no

Values
A collection of values used as the default values for the dialog. Use the GetValuesCollection method to create the collection and its AddItem method to add the default values. Supply two values for the between and not between operators, up to ten values for the is one of and is not one of operators, and only one value for the rest of the operators. This parameter is optional; if it isn't specified, blank values are used as defaults.

Return Value
A collection of value objects. A value object has a single property, Value, which contains the value the user entered for the field value. If the user chooses Cancel rather than entering a value, the collection Count property is 0. Otherwise, the collection contains two members for the between and not between operators, up to ten members for the is one of and is not one of operators, and one member for the others.

Example
See Select for example code.

See also

DataEngine Object | GetValuesForParameter | Select