Choices property

Sets or returns a SAFEARRAY of BSTRs that list the choices in the drop-down list of a Database Column or a Custom Field Definition, or the choices that users vote on in a Poll Entry.

Syntax


C++

HRESULT get_Choices(VARIANT* pChoices)

HRESULT put_Choices(VARIANT myChoices)

Scripting languages

Variant = object.Choices

object.Choices = Variant

Remarks


For Database Columns and Custom Field Definitions, you can only set the Choices property if the DataType property is set to erCustomFieldDataTypeDropDown.

For Poll Entries, you can't change the choices for a PollEntry once someone has voted on the question.

If the set of choices is empty, the returned VARIANT is empty. This condition can be checked in Visual Basic by using the IsEmpty function:

If Not IsEmpty(cfdef.Choices) Then
   For Each choice In cfdef.Choices

  'do something

   Next

End If

When retrieving the Choices property, the lower bound of the returned array is always 1, regardless of the lower bound of the array supplied when modifying it.

Home

Applies to

IERUCustomFieldDef

IERUDBColumn

IERUPollEntry


See Also

Polls

Databases