This program will use the Data Control to bind TextBoxes (and ComboBox) to the columns in
the database. Once this configuration is complete, you will have a full application that
can Display and Update the information in the database. With a little tweak, you can
change the program to be able to add new rows.
Here is the User Interface:
After adding the Label / TextBox combinations, add the Data Control to the form and set the properties
![]() |
The ToolBox Icon |
![]() |
Set the Data Control properties as follows:
|
Bind each TextBox to the associated Table Column
![]() |
First select the Data Source. There should only be one item listed as
there is only one Data Control. This must be completed before setting the Data Field
property. Again, ALWAYS select this item and NEVER type in tyhe name directly. Next, select the column from the table that you want to associate (or Bind) to this TextBox. Perform this sequence for each TextBox on the Form This completes the BIND |
The project is complete. Run the application, and use the Data Control buttons to move between table rows. Make a change to one of the TextBoxes and the move off, and then back to the modified row. The move operation will update any changes made to the data.
Change the EOFAction property on the Data Control to AddNew.
Run the program, move to the last table record. Pressing the Next button will set the EOF (End of File) condition. This action was just changed to AddNew, which will add a blank record to the database. You should fill in the blank TextBoxes, and then move off, and then back to this row.
This application and Display, Update, and Add new rows to your table.
How much Code? None!
Download the Completed Example