Visual Basic: DataGrid Control

AllowAddNew Property

See Also   Example   Applies To

Returns or sets a value indicating whether the user can add new records to the Recordset object underlying a DataGrid control.

Syntax

object**.AllowAddNew** [**=**value]

The AllowAddNew property syntax has these parts:

Part Description
object An object expression that evaluates to an object in the Applies To list.
value A Boolean expression that determines whether a user can add new records, as described in Settings.

Settings

The settings for value are:

Setting Description
True Users can add records to the Recordset object underlying the DataGrid control.
False Users can't add records to the Recordset underlying the DataGrid control.

Remarks

If the AllowAddnew property is True, the last row displayed in the DataGrid control is left blank to permit users to enter new records. If the AllowAddNew property is False, no blank line is displayed.

The underlying Recordset may not enable insertions even if the AllowAddNew property is True. In this case, an error occurs when the user tries to add a record.