CreateLabel Method
Creates an attached or freestanding label.
Signature
RetVal = object.CreateLabel(Arg1, KeyValues, LabelTemplate [, DisplayValues])
Object
LinkTemplate The object or objects this method applies to.
Arg1
Long for object ID, or
Variant (three-element array of Doubles); input-only
The graphical object to attach the label to, or the
insertion point for a freestanding label.
KeyValues
KeyValues collection; input-only
The key field values for the label.
LabelTemplate
LabelTemplate object,
or String naming a label template; input-only
The label template for the label object.
DisplayValues
Variant (array of Variants); input-only; optional
Values to be displayed in the label if no matching key field is found in
the database table.
RetVal
The new label object.
Remarks
The values displayed in the created label depend on which arguments are passed to CreateLabel. Those values may be affected by a subsequent call to the Reload method. CreateLabel behaves as follows:
- If a DisplayValues argument is supplied, the argument values are displayed in the label.
- If DisplayValues is not specified, CAO attempts to retrieve a linked row from the database. If successful, values from the row are displayed in the label. If a linked row cannot be obtained (for example, no connection exists or key values have no match in the database), an error occurs.
- If a DisplayValues argument is supplied, but you follow CreateLabel with a call to the Reload method, CAO attempts to retrieve a linked row from the database. If successful, database values are displayed in the label; if a linked row cannot be obtained, an error occurs.