Itemsselected run time error

B

Bruce Maston

I have been frustrated by an elusive error in my A2K app., and I may have
stumbled on the cause of the problem. I share my experience here along with
a question as to whether I am correct.

The error: I have a pop-up form that appears to work properly, but when the
form closes it somehow "empties" listboxes in the underlying form. The list
of items in the boxes look o.k., but clicking on them gets a run time error
that the boxes are actually set to null.

What makes this frustrating is that if you step through (F8) the code you
cannot reproduce the error. Every thing works fine when you step through the
code, and there is no way to figure out where the problem is.

I've asked questions in this forum in the past as to what would be going on
where the application running at "full speed" crashes but taken one step at a
time works o.k., and I've never gotten an answer.

Today I noticed that a list box on the offending form has the property for
multi select set to "none" (single click only allowed) in the property window
while the box actually allows multiple selections (you can click more than
one item). My VBA code has an on_click event for the list box, and within
the event I've used Itemsselected. So what I've done is coded for a "simple"
multi select, but nowhere have I set the list box to multi select "simple".

So the Itemsselected code is overriding the property window for multi select
being set to "none" (rather than "simple").

I'm wondering if this has created a "conflict" that is the reason why my
code fails at full speed but works when stepping through it?

Does this make sense, and have others had this same problem?
 
A

AccessVandal via AccessMonster.com

I don't think I have a solution.

Did anyone suggested decompiling, compact and repair and than compile again?

I know your db is A2K format, but are you running this db in A2K3 or 2007?
There might be an issue if you code your listbox in newer version.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top