How To Clear the Contents of a DBGrid ControlLast reviewed: May 7, 1996Article ID: Q150468 |
The information in this article applies to:
SUMMARYThis article describes how to clear the contents of a DBGrid control. A DBGrid control is bound to a Data control. To clear the DBGrid control of all data, set the RecordSource property of the Data control so no records are returned, and then execute the Refresh method on the Data control. The DBGrid control displays the data retrieved by the Data control.
MORE INFORMATIONThe following instructions show how to create a sample program that demonstrates how to clear the DBGrid control. The form contains a DBGrid control bound to a Data control. The Data control is bound to the sample database shipping with Microsoft Visual Basic, BIBLIO.MDB, and the RecordSource is set to the Titles table. Two Command buttons are used to populate and clear the DBGrid control. To clear the DBGrid control, the RecordSource is set to a SQL statement that does not return any records. To populate the DBGrid control, the RecordSource property is set to the Titles table. When you run the program, the DBGrid control is immediately populated because the RecordSource property of the Data control is bound to the Titles table. Click the Command button to clear the DBGrid control. Follow these instructions to create a sample application that demonstrates this process:
|
Additional reference words: 4.00 vb4win vb4all
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |