Type Property

       

Sets or returns the type of formatting applied by the StdDataFormat object. Based on this setting, other properties of the object are used to format the value. Read/write both at design time and run time.

Syntax

object.Type = formattype

The Type property syntax has these parts:

Part Description
object An object expression that evaluates to an object in the Applies To list.
formattype Required enumerated integer. Specifies the type of formatting desired, as described in Settings.

Settings

The settings for formattype are:

Constant Setting Description
fmtGeneral 0 No formatting is applied to the value.
fmtCustom 1 The format string contained in the Format property is used to format and unformat the value.
fmtPicture 2 The value is treated as a picture. A binary object read from the database is translated into a picture object, and written back to the database as a binary object.
fmtObject 3 The value is treated as an object. The StdDataFormat object expects to retrieve a CLSID from the database. The CLSID is used to instantiate the object, which is returned from the StdDataFormat object. The CLSID is then read from the object being formatted when the value is returned to the database.
fmtCheckbox 4 This setting is used to bind a check box to a database field. The database value is treated as the check box Value property. Return values are specified in the table under Remarks. The formatted values are only meaningful for a check box control whose Value property is of type OLE_TRISTATE. For general Boolean types, use fmtBoolean.
fmtBoolean 5 The value is treated as a Boolean value. When this type is chosen the TrueValue and FalseValue properties, and, depending on the type of database, the NullValue property, are used to determine how the value should be formatted. If none of those properties are set, the default behavior is to return the logical value from the database.

Remarks

This table lists return values associated with the fmtCheckbox setting, as described above.

Database Value Formatted Value
Logical False 0
Logical True 1
Null 2

To reset the Type property at run time you must unbind, set the property, and then rebind.