Hi,
I have a form that allows a user to modify a record using a class behind the form. Once the record is saved, the form closes and a listbox on the main form is populated via SQL with the updated records from the DB.
The problem seems to be that when the listbox is populated, the class has not yet saved the data to the db (I am still seeing the old information in the listbox - although not all the time). This leads me to believe that this has something to do with threads...not sure, just a guess. I have tried increasing the time between save and list populate by using loops, but depending on what is running on my machine at the time, the times are still not enough or more than necessary.
Is there any way to ensure that the class has written the data to the DB before returning to the calling procedure?
Any thoughts?
I have a form that allows a user to modify a record using a class behind the form. Once the record is saved, the form closes and a listbox on the main form is populated via SQL with the updated records from the DB.
The problem seems to be that when the listbox is populated, the class has not yet saved the data to the db (I am still seeing the old information in the listbox - although not all the time). This leads me to believe that this has something to do with threads...not sure, just a guess. I have tried increasing the time between save and list populate by using loops, but depending on what is running on my machine at the time, the times are still not enough or more than necessary.
Is there any way to ensure that the class has written the data to the DB before returning to the calling procedure?
Any thoughts?