This is the fourth chapter of a thirteen part series regarding the creation of database forms with HTML. In this article we will continue discussing the functions relevant to the development process, including showNextRow(), showLastRow(), showFirstRow(), addRow(), and addRowToRecordset(). Join us as we edge toward completion.
More Database Form Functions with HTML (Page 1 of 6 )
The showNextRow() Function
If the user has just finished typing in the add-mode, the addMode variable would be true. If the user has just finished typing in the edit-mode, the editMode variable would be true. The function first checks if the user was in the add-mode. If he was there, it completes the Add process by calling other functions. Then it sets the add-mode variable to false. It then checks if the user was in the edit-mode. If he was there, it completes the Edit process by calling other functions and setting the edit-mode variable to false. It goes on to display the next row of the recordset. This is the code:
//add to recordset any data that might have been included in the controls
if (addMode == true)
//after adding, you must go out of the addMode, so reset the addMode variable
addMode = false;
//enable the buttons that were disabled in the Add process
//edit any row of the recordset that might have been edited at the form
if (editMode == true)
//after adding, you must go out of the editMode, so reset the editMode variable
editMode = false;
//enable the buttons, Edit, Delete, Clear, Find, Sort.