ConvertToField Method

Microsoft FrontPage Visual Basic

Show All Show All

ConvertToField Method

Changes a field from one type to another and returns the object specified in the Type parameter.

expression.ConvertToField(Type)

expression    Required. An expression that returns one of the objects in the Applies To list.

Type    Required FpFieldType. Specifies the type of field to which to convert the specified field.

FpFieldType can be one of the following FpFieldType constants.

fpFieldAttachmentsReturns a ListFieldAttachments object.
fpFieldChoiceReturns a ListFieldChoice object.
fpFieldComputedReturns a ListFieldComputed object.
fpFieldCounterReturns a ListFieldCounter object.
fpFieldCurrencyReturns a ListFieldCurrency object.
fpFieldDateTimeReturns a ListFieldDateTime object.
fpFieldFileReturns a ListFieldFile object.
fpFieldIntegerReturns a ListFieldInteger object.
fpFieldLookupReturns a ListFieldLookup object.
fpFieldMultiLineReturns a ListFieldMultiline object.
fpFieldNumberReturns a ListFieldNumber object.
fpFieldRatingScaleReturns a ListFieldRatingScale object.
fpFieldSingleLineReturns a ListFieldSingleLine object.
fpFieldTrueFalseReturns a ListFieldTrueFalse object.
fpFieldURLReturns a ListFieldURL object.

Remarks

The following chart specifies whether one field type can be converted to another field type and how the conversion works if special conversion is necessary.

From Field/ ToFieldTextChoiceNoteNote (Rich Text Enabled)NumberCurrencyDateTimeBooleanMulti-valued choice
TextN/AYesYesYesYes; converts numbers and sets other values to NULLYes; converts numbers and sets other values to NULLYes; converts dates and sets other values to NULLNoYes
ChoiceYesN/AYesYesYes; converts numbers and sets other values to NULLYes; converts numbers and sets other values to NULLYes; converts dates and sets other values to NULLNoYes
NoteYes; converts and truncates text to less than 255 characters.Yes; converts and truncates text to 255 characters.N/AYesYes; converts numbers and sets other values to NULLYes; converts numbers and sets other values to NULLYes; converts dates and sets other values to NULLNoYes; converts numbers and sets other values to NULL
Note (Rich Text Enabled)NoNoYesN/ANoNoNoNoNo
NumberYesYesYesYesN/AYesNoYes; converts zero and under to False and greater than zero to True.Yes
CurrencyYesYesYesYesYesN/ANoYes; converts zero and under to False and greater than zero to True.Yes
DateTimeYesYesYesYesNoNoN/ANoYes
BooleanYes; converts to 0 or 1.Yes; converts to 0 or 1.Yes; converts to 0 or 1.Yes; converts to 0 or 1.Yes; converts to 0 or 1.Yes; converts to 0 or 1.NoN/AYes; converts to 0 or 1.
Multi-value choiceYesYesYesYesYes Yes Yes NoN/A