Posted Thursday, May 8, 2008 @ 14:14:43
Thanks, I am aware of setDatabaseUpdateMode(); however, that's just for updating existing rows. Try this:
1. Starting with empty tables, run AddModifyDeleteTable.
2. Click the "add button" to add a new row.
3. Type in Emp_Number, Emp_Name, Emp_Status.
4. Now try to get that row inserted into the database without adding another new record.
The only way I can get the single new record inserted into an empty table is by adding a second new record, because that's the only way to "move away from the row" just entered in an empty table. But it doesn't make sense to have to enter a second dummy row just to get the first new row inserted.
Even in a table with multiple rows, the idea of requiring a user to move away from a new row in order to get it inserted is also problematic for other reasons. For instance, say a user creates a new row and enters several cells of data without then pressing Tab or Enter to get to another row in the table. Then the user clicks into another control on the frame such a text box or, worse yet, the user quits the application. While the user would expect the data to have been saved, it was in fact never inserted and is lost. In this case, the table should see that it is losing focus and it should commit the insert. I'm just looking for a way to catch this and get the data inserted.
Thanks,
Jeff