FormatFieldValue
Applies to
VAccess
Description
Returns the value of a field in the current record formatted using the specified format string.
Syntax
object
.
FormatFieldValue
(fieldname
, formatstring
)
The syntax for this method has the following parts:
Part
Description
object
Required. The object placeholder represents an object expression that evaluates to an object in the Applies To list.
fieldname
The name of any valid field in the file referenced by
object.
formatstring
This parameter supports the same format strings and standard format names for number, date, and time values as the Visual Basic Format function.
Remarks
If a field is formatted, the value for the contents of that field will always be returned as a String, regardless of data type (the container may automatically translate this to a String, Variant, AnsiString, or other variety of character data). If a field is not formatted, the value will be returned as the Variant that most closely approximates the data type of the field. Most control containers can manipulate, internationalize, and re-format this returned variant much more easily and quickly than a String. For this reason, we recommend that unformatted fields be retrieved whenever possible.
Example
Label1.Caption = VAccess1.FieldValue("msa_desc")
Label2.Caption = _ VAccess1.FormatFieldValue("population", "##,###,###")
See Also
FieldValue, RowColumnValue, Column