>

DataUpdatable Property

Applies To

Field Object.

Description

Returns a value that indicates whether the data in the field represented by a Field object is updatable. Returns a True (-1) if the data in the field is updatable.

Remarks

Use this property to determine whether you can change the Value property setting of a Field object. The DataUpdatable property is always read-only. It is not supported on Field objects appended to the Fields collection of Index and Relation objects.

See Also

Updatable Property, Value Property.

Example (Microsoft Access)

The following example creates two Recordset objects, a dynaset-type Recordset object and a snapshot-type Recordset object, from the same table. The procedure then checks the DataUpdatable property for the LastName field in each Recordset object. The value of the DataUpdatable property is True (-1) for the dynaset-type Recordset object, and False (0) for the snapshot-type Recordset object.


Sub CheckUpdatable()
    Dim dbs As Database
    Dim rstDynaset As Recordset, rstSnapshot As Recordset
    Dim fldDynaset As Field, fldSnapshot As Field

    ' Return Database variable that points to current database.
    Set dbs = CurrentDb
    ' Open dynaset-type Recordset object.
    Set rstDynaset = dbs.OpenRecordset("Employees", dbOpenDynaset)
    ' Open snapshot-type Recordset object.
    Set rstSnapshot = dbs.OpenRecordset("Employees", dbOpenSnapshot)
    ' Get Field object variables pointing to field in each Recordset 
'object. Set fldDynaset = rstDynaset.Fields!LastName Set fldSnapshot = rstSnapshot.Fields!LastName ' Get current record. rstDynaset.MoveFirst rstSnapshot.MoveFirst ' Display value of DataUpdatable property for each Recordset object. Debug.Print "DataUpdatable (Dynaset-type Recordset): "; _ fldDynaset.DataUpdatable Debug.Print "DataUpdatable (Snapshot-type Recordset): "; _ fldSnapshot.DataUpdatable End Sub