Weird problem with listbox

Ggilmann

Member
Joined
Feb 12, 2011
Messages
17
Location
Canada
Programming Experience
3-5
Hello everyone,

I've got this weird problem with a listbox on my form. First of all, some context. I'm developping a windows form interface for an access 2007 database. The interface is to be used from a third party application.

On my form, I have a listbox that is bound to my DB. The datasource of the listbox is set to a particular table in my DB. The data, from my table shows up as expected. However, when I click on a row of my listbox, it's like the focus freezes on the listbox. Afterwards, I can't click on anything else on my form, I can't even close it. I have to stop the debugger and start again.

I really can't see what causes this, any help will be greatly appreciated.

Thanks

Ggilmann
 
Do you have write access to the database? Seems like you can read but not write what is causing that may be someone else has it open, or it may be read only, or something else.
 
When this "freeze" occurs, click the Break All button in the IDE (looks like a Pause button) and see where the IDE tells you that you are in the code. Presumably you are handling some event and entering an endless loop or calling some method that never returns.
 
I've tried clicking the Pause button after i clicked on the listbox. The code stops, but I can't find any lines in yellow, is that what I should be looking for? I do see some lines in grey though.

Asides from that, I know I have read-write access to the DB. Also When I change the selection in the listbox, like I said everything on my form freezes and is unaccessible, except the listbox. I can still change the selected item in the listbox. I just can't get out of the listbox...

There are no events linked to the listbox yet so this shouldn't be an issue. This leads me to believe that it has something to do with the fact that the list box's content is bound to my database.


I tried finding more info on the web but can't, I appreciate all your help.

Ggilmann
 
Fixed!

FIXED!

I decided to scrap my original listbox and bindings and start over and it fixed it. Still not sure what was the problem. I had accumulated multiple databindings since I had tried a couple of times to add a listbox controls, maybe there was some confusion there.

Anyways, it works now, thanks.


Ggilmann
 
Having the same problem ...

I also have a listbox which is bound to an Access DB. I'm getting the same problem where, once selected, I cannot move away from the listbox and I have to stop de-bugging. Can anyone help please?
 
Unfortunately, I couldn't find the exact source fo the problem. What I ended up doing was deleting the problematic listbox and starting over, maybe you should try that?
 
Many thanks for your quick reply. Did as you suggested and started over a couple of times but still had the same problem - I then put in a new listbox but did not resize it (as I had being doing for every other one) and hey presto it works fine!! Maybe it has something to do with the resizing? Who knows!! I'm just glad it works now - thanks again :)
 
Back
Top