Type Property

Applies To:

Field object


The ChemFinder field type.


CFFieldType Field.Type


Each field type is represented by a constant as shown below:

kCFDate = 8
kCFFormula = 4
kCFInteger = 1
kCFLong = 1
kCFMemo = 7
kCFMolWeight = 5
kCFPicture = 6
kCFReal = 2
kCFStructure = 3
kCFText = 0


In order to perform a meaningful formula search, you would want to be sure that you were querying on a field of the type kCFFormula. The following Visual Basic code uses to the Type property to verify this, and searches only if the field named "Formula" is of the correct type.
Dim FinderDoc As Object  'Document
Dim RecSet As Object 'Recordset object
Dim FieldName As String   'Name of field
Dim molQuery As Object   'Molecule object required by Search method
Dim FormulaQuery As String 'Formula argument for Search method
Dim Value As Variant 'Variable for data in field not kCFFormula type


FieldName = "Formula" 'Name of field
Set RecSet = FinderDoc.Recordset  'Set Recordset

'Condition of search
If (FinderDoc.Fields(FieldName).Type = kCFFormula) Then
     Set molQuery = Nothing  'Required argument may be set to Nothing
     FormulaQuery = "C6 N1-2" 'Formula for query
     FinderDoc.Search molQuery, FormulaQuery 'Search document

     Value = RecSet(FieldName) 'Otherwise get data in field
End If

See Also:

2005 CambridgeSoft Corporation. All Rights Reserved. Privacy Statement
Tel  800 315-7300 / 617 588-9300     Fax  617 588-9390     Email   info@cambridgesoft.com
CambridgeSoft Corporation, 100 CambridgePark Drive, Cambridge, MA 02140 USA