Listbox OnDblClick Fires Every Other Time

Sorrells

Registered User.
Local time
Today, 07:20
Joined
Jan 13, 2001
Messages
258
Access XP on Win2000 Dell GXi

What can I say??? I have two forms that are very similar. One handles the double-click just fine and the other will fire only every other time.

I have a breakpoint in the procedure. I double-click and nothing, double-click again and it hits the breakpoint.

This code for the class module is 33 pages so I am looking for general advice. There are no other events for the listbox with code. I did not check the properties however, could there be something there?

Any thoughts are appreciated. I just seem to keep bumping into strange stuff!
 
I'll guess: Are you selecting an item in the first dbl-click and then de-selecting it in the next double-click? And, if so, is your code only acting on selected items?

Regards,
Tim
 
pono1,

Yes, it reacts like that. I can single or double-click the first time and it has focus, either of the above followed by a double-click fires the OnDblClick.

What does that tell you?
 
Sorrells,

It tells me that the control and your code are acting in a way you didn't expect (if I'm understanding you) and that you are feeling too exasperated (or overwhelmed) to troubleshoot the thing.

Are you are using a listbox that has its Multiselect prop set to extended? Experiment with the listindex property...

Code:
'Select the item double-clicked no matter what.
	Me.ListBox.Selected(Me.ListBox.ListIndex) = True

Or you may want to forego the double-click event entirely and add a command button, putting your code behind its on-click event to act on selected listbox items. Or if the double-click event is the only way to go for you, besides working through the 33 pages of code you may also want to experiment with the Multi-Select Property of your listbox (None, Simple, Extended)...

Hang tough --- there's always a reason and usually a fix.

Regards,
Tim
 
Tim,

You are certainly right about my state of mind! I've tabled it for a few days going on to other aspects.

The listbox MultiSelect is set to NONE. I did have code set to OnClick but still had the same problem. As for the double-click, this is a client request.

You comments brought up another thought that I will pursue, that is, I have been trying in various events to deselect records both in the listbox and the subform controls of the form. I may be stepping on my own toes.

Thanks for you comments! I'll be getting back to this late Friday or Saturday.
 
Sorrells said:

You are certainly right about my state of mind! I've tabled it for a few days going on to other aspects.

Probably a wise move. Post back with any interesting discoveries...

Regards,
Tim
 
Boy, I did not intend to let this hang open for so long! I solved the problem about 3 weeks ago. The form was corrupt.

I created a new form, copied the objects from the old to the new. Copied the code behind them next.

I then changed the form name to the production one and had no more problems.
 

Users who are viewing this thread

Back
Top Bottom