FieldClass

Method
Retrieves the class of a specified field.

Category
Fields

 

Syntax
Function FieldClass(ByVal hTable As Long, ByVal FieldNo As Long) As Short

hTable
The handle to the table.

FieldNo
The number of the field whose class is to be determined.

 

Example

'Case "FieldInfo"

'Lists the information about the fields in the customer-table

  tmpLong = CF1.NextField(hTable, 0)

  Do While tmpLong <> 0

  tmpBool = False

  tmpStr = Str$(CF1.FieldLen(hTable, tmpLong)) & ", "

  tmpVar = CF1.FieldName(hTable, tmpLong)

  If VarType(tmpVar) = vbString Then

  tmpStr = tmpStr & tmpVar & ", "

  tmpVar2 = CF1.FieldNo(hTable, tmpVar)

  If VarType(tmpVar2) = vbLong Then

  tmpStr = tmpStr & tmpVar2 & ", "

  tmpVar2 = CF1.FieldType(hTable, tmpLong)

  If VarType(tmpVar2) = vbInteger Then

  tmpStr = tmpStr & tmpVar2 & ", "

  tmpVar2 = CF1.FieldSize(hTable, tmpLong)

  If VarType(tmpVar2) = vbInteger Then

  tmpStr = tmpStr & tmpVar2 & ", "

  tmpVar2 = CF1.FieldClass(hTable, tmpLong)

  If VarType(tmpVar2) = vbInteger Then

  tmpStr = tmpStr & tmpVar2 & ", "

  tmpVar2 = CF1.FieldOptionStr(hTable, tmpLong)

  If VarType(tmpVar2) = vbString Then

  tmpStr = tmpStr & tmpVar2

  tmpLong = CF1.NextField(hTable, tmpLong)

  tmpBool = True

  End If

  End If

  End If

  End If

  End If

  End If

  If Not (tmpBool) Then

  Exit Do

  End If

  Loop

  If tmpBool Then

  tmpStr = "Fieldinfo from the last field: " & tmpStr

  logWr tmpStr

  Else

  logWr "Error in a return value"

  End If

 

  CF1.CloseTable hTable

 

Comments
There are three different classes of fields: Normal, FlowField or FlowFilter. FieldClass returns the class of the field with number FieldNo.

If FieldNo does not exist, the function will raise an exception.

FieldClass returns one of the following three values:

Value:

Meaning:

0

Normal field

1

FlowField field

2

FlowFilter field

While ordinary fields are stored in the database, FlowFields are virtual fields that contain information about other tables in the database. These fields are not saved with the table. To update the FlowFields you must call CalcFields.

FlowFilter fields are also virtual fields. The values in FlowFilter fields are used as parameters for calculating FlowFields.

For more information about field classes, see the Application Designer’s Guide.



© 2009 Microsoft Corporation. All rights reserved.