ComponentOne True DataControl 8.0
UserAddData Event

 

UserAddData Event

Occurs when a new row is added in DataMode = 2 - UserEvents.

Syntax

TData_UserAddData(ByVal RowBuf As TrueData60Ctl.RowBuffer, NewRowBookmark As Variant)

Remarks

Arguments: RowBuf is a RowBuffer object used to transfer new row data to the control.

NewBookmark is a variant that must be set to a unique bookmark for subsequent references to the newly added row.

In user events mode (DataMode set to 2 - User Events), the UserAddData event is fired whenever a new row of data has been added and the user commits the changes by leaving the newly added row or calling Recordset.Update. You do not need to write a handler for this event unless you want to create your own data source. See User Events Mode for details.

The RowBuf argument contains a single row of data to be written to your custom data source. Since only one row of data can be added at a time, the value of its RowCount property will always be 1. The number of columns in a RowBuffer is given by its ColumnCount property.

The Value property of the RowBuf argument contains the field data entered by the user. If the user did not enter the value of a particular field, then the corresponding entry in the Value property will contain an Empty variant. In Visual Basic, the IsEmpty function can be used to test for this condition.

Before returning from this event, NewRowBookmark must be set to the bookmark of the newly added row.

If your event handler is unable to add the new row, you should notify the TData control by setting the NewRowBookmark argument to Null. TData will interpret this as a signal that the row has not been added because of an error condition. If you can qualify the error condition, use the RaiseError method to describe the error. Then TData control's clients, the bound controls, will receive the appropriate error information.

See Also

TData Control

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback