DatabaseField.CurrencyValue

From Xojo Documentation

Revision as of 18:43, 10 July 2019 by Gperlman (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Property (As Currency )
aDatabaseField.CurrencyValue = newCurrencyValue
or
CurrencyValue = aDatabaseField.CurrencyValue

Supported for all project types and targets.

Used to get and set the values of Currency field types.

Notes

For situations where you need to set a database column to NULL, you should use the Value property like this:

rs.Edit
rs.Field("MyCurrencyColumn").Value = Nil // sets to NULL in the database
rs.Update

Sample Code

Get the currency value of a column in a RecordSet:

// rs is a RecordSet with a currency column called "Amount"
Dim amount As Currency
amount = rs.Field("Amount").CurrencyValue

Set the currency value of a column in a RecordSet:

// rs is a RecordSet with a currency column called "Amount":
rs.Edit
rs.Field("Amount").CurrencyValue = 123.45
rs.Update