Items not clearing from listview... kind of...

Reapz

Regular
Joined
Dec 15, 2002
Messages
74
I have a listview which is populated from a DB. The code for this works fine.
I also have code which adds or deletes entries to or from the DB. This too works fine.

For example...

User selects an item in the listview... clicks delete... code runs to delete the item from the DB (this works)... calls sub to repopulate the listview the first line of which calls a small sub to clear the items, groups and column properties of the listview (this works)... rest of code retrieves the new info from the DB and fills the listview (this also works).

The problem is that when I run the app' I have to repopulate the listview twice to see the changes. However, if I step through the code a line at a time I can see the changes first time round.

So, I know the code works but I don't know why the listview doesn't display correctly when the app' is running at full speed.

Is it something to do with the time it takes to make the changes to the DB?
 
Last edited:
Forget it... I'm being an idiot. I was tidying up my code earlier and I'd copied and pasted from another section and missed out the line that closes the connection to the DB. Doh! :o

Was wondering why it worked yesterday.

Sigh...
 
Back
Top