Freigeben über


Field2.DataUpdatable-Eigenschaft (DAO)

Gilt für: Access 2013, Office 2013

Gibt einen Wert zurück, der angibt, ob die Daten eines durch ein Field2-Objekt dargestellten Felds aktualisiert werden können.

Syntax

Ausdruck . DataUpdatable

Ausdruck Eine Variable, die ein Field2-Objekt darstellt.

Hinweise

Ermitteln Sie mit dieser Eigenschaft, ob Sie die Einstellung einer Value -Eigenschaft eines Field2-Objekts ändern können. Diese Eigenschaft ist bei einem Field2-Objekt immer False, dessen Attributes -Eigenschaft auf dbAutoIncrField festgelegt ist.

Sie können die DataUpdatable-Eigenschaft bei Field2-Objekten verwenden, die der Fields -Auflistung der Objekte QueryDef, Recordset oder Relation hinzugefügt werden, nicht jedoch der Fields-Auflistung der Objekte Index oder TableDef.

Beispiel

This example demonstrates the DataUpdatable property using the first field from six different Recordsets. The DataOutput function is required for this procedure to run.

Sub DataUpdatableX() 
 
 Dim dbsNorthwind As Database 
 Dim rstNorthwind As Recordset 
 
 Set dbsNorthwind = OpenDatabase("Northwind.mdb") 
 
 With dbsNorthwind 
 ' Open and print report about a table-type Recordset. 
 Set rstNorthwind = .OpenRecordset("Employees") 
 DataOutput rstNorthwind 
 
 ' Open and print report about a dynaset-type Recordset. 
 Set rstNorthwind = .OpenRecordset("Employees", _ 
 dbOpenDynaset) 
 DataOutput rstNorthwind 
 
 ' Open and print report about a snapshot-type Recordset. 
 Set rstNorthwind = .OpenRecordset("Employees", _ 
 dbOpenSnapshot) 
 DataOutput rstNorthwind 
 
 ' Open and print report about a forward-only-type Recordset. 
 Set rstNorthwind = .OpenRecordset("Employees", _ 
 dbOpenForwardOnly) 
 DataOutput rstNorthwind 
 
 ' Open and print report about a Recordset based on 
 ' a select query. 
 Set rstNorthwind = _ 
 .OpenRecordset("Current Product List") 
 DataOutput rstNorthwind 
 
 ' Open and print report about a Recordset based on a 
 ' select query that calculates totals. 
 Set rstNorthwind = .OpenRecordset("Order Subtotals") 
 DataOutput rstNorthwind 
 
 .Close 
 End With 
 
End Sub 
 
Function DataOutput(rstTemp As Recordset) 
 
 With rstTemp 
 Debug.Print "Recordset: " & .Name & ", "; 
 Select Case .Type 
 Case dbOpenTable 
 Debug.Print "dbOpenTable" 
 Case dbOpenDynaset 
 Debug.Print "dbOpenDynaset" 
 Case dbOpenSnapshot 
 Debug.Print "dbOpenSnapshot" 
 Case dbOpenForwardOnly 
 Debug.Print "dbOpenForwardOnly" 
 End Select 
 Debug.Print " Field: " & .Fields(0).Name & ", " & _ 
 "DataUpdatable = " & .Fields(0).DataUpdatable 
 Debug.Print 
 .Close 
 End With 
 
End Function