AllowAddNew
This property, added in VFP 5, gives you control over whether users can add new records to a grid by moving down out of the last item. Usage | grdGrid.AllowAddNew = lLetUserAdd lLetUserAdd = grdGrid.AllowAddNew |
AllowAddNew respects a table's read-only status. However, when the table is read-only for any reason (the table's or the grid's ReadOnly property is set to .T., the table was explicitly opened read-only with USE NOUPDATE or was created by a SELECT without READWRITE), attempting to add a record by pressing the down arrow gives you the error message "Cannot update selected cursor." We think this is terrible behavior—the down-arrow press should be ignored, just as it would be if AllowAddNew were set to .F. |
Example | * You might let the user know that she can * add records. IF This.AllowAddNew * Make a label visible and set its caption ThisForm.lblAddMsg.Caption = ; "Add items by pressing down-arrow" ThisForm.lblAddMsg.Visible = .T. ENDIF |
See Also | Append, Insert-SQL, ReadOnly |
View Updates
Copyright © 2002 by Tamar E. Granor, Ted Roche, Doug Hennig, and Della Martin. All Rights Reserved.