Johannes Schade
Sep 14th, 2000, 10:56 AM
Dear Friends
I write a front-end to a SQL Server database in VB6 using ADO recordsets. I have a couple of bound text boxes. I use AdoDc1.Recordset.Update on the Form_Unload event. However when I edit something in a text box and then quit immediately (without clicking anywhere else), I lose the edit in the text box. If I click into another textbox after the edit, then the edit will be saved by the update method.
I tried to use Me.Text1.SetFocus in the Form_unload event to try to mimick this additional mouseclick, but it does not do it. AdoDc1.Move 0 will save the edit, but this triggers AdoD1_MoveCompleted which I am trying to avoid because I also have a Datagrid on the form which needs to be reloaded whenever the record changes and I do not want to reload it when quitting. There are similar problems in DataGrid where last edits are lost, but this should probably be a different post.
With Many Thanks
I write a front-end to a SQL Server database in VB6 using ADO recordsets. I have a couple of bound text boxes. I use AdoDc1.Recordset.Update on the Form_Unload event. However when I edit something in a text box and then quit immediately (without clicking anywhere else), I lose the edit in the text box. If I click into another textbox after the edit, then the edit will be saved by the update method.
I tried to use Me.Text1.SetFocus in the Form_unload event to try to mimick this additional mouseclick, but it does not do it. AdoDc1.Move 0 will save the edit, but this triggers AdoD1_MoveCompleted which I am trying to avoid because I also have a Datagrid on the form which needs to be reloaded whenever the record changes and I do not want to reload it when quitting. There are similar problems in DataGrid where last edits are lost, but this should probably be a different post.
With Many Thanks