HELP! List box Select Problems!

  • Thread starter Thread starter Kevin
  • Start date Start date
K

Kevin

Hi there,

I have a list box that is bound to a temporary table in my
frontend application. It is set to Extended multiselect.
If there are ten items in the list and I choose just the
fifth item in the list by double clicking, it selects the
item chosen and all four items above the one choosen in
the list. The code that I have that is supposed to pick
the item choosen, then grabs the very top item in the
list, not the one I was attempting to pick.

This used to work correctly with the properties I have
set. I am not sure what might have changed!

HELP! I need to get this fixed ASAP because I am falling
rapidly behind on delivering this application!

Thanks!

Kevin
 
Hi Kevin,

You need to post your code so we don't have to guess at what might be wrong
:-)
 
This code is executed on the ondoubleclick event:

With Me![Consolidated_Items]

For item_selected = 0 To .ListCount - 1
If (.selected(item_selected)) Then

my_Items = .ItemData(item_selected)

****The following is not part of me code********* a number
of querydef queries were here that modify data in several
related tables. I have deleted this because I do not
believe it is necessary for this discussion and would only
lead to confusion. Plus this is the only code that is
associated with this field and it is not fired until after
the selection is made in the listbox. There is also a
series of if statments that look to see if the current
user is a member of one of three groups. If he/she is then
the modifications intended will be allowed to occur, if
not the routine is ended.

Generally the code deleted is as follows (all variables
and objects were properly declared with dim statements):

sqlstr="myQuery" ' String object
set qdf=db.db.CreateQueryDef("", sqlStr)
qdf.Execute

There are several of these type statments modifying data
in several tables. Then the field is requeried. Again
though, none of this happens until after the selection is
made in the field and the item selected is the very first
(or topmost) item in the list, not the item I have chosen.
***************

Next item_selected

End With

This is the only code executed from this field. The only
code associated with the form is executed from the onOpen
event.

-----Original Message-----
Hi Kevin,

You need to post your code so we don't have to guess at what might be wrong
:-)


--
Sandra Daigle
[Microsoft Access MVP]
For the benefit of others please post all replies to this newsgroup.

Hi there,

I have a list box that is bound to a temporary table in my
frontend application. It is set to Extended multiselect.
If there are ten items in the list and I choose just the
fifth item in the list by double clicking, it selects the
item chosen and all four items above the one choosen in
the list. The code that I have that is supposed to pick
the item choosen, then grabs the very top item in the
list, not the one I was attempting to pick.

This used to work correctly with the properties I have
set. I am not sure what might have changed!

HELP! I need to get this fixed ASAP because I am falling
rapidly behind on delivering this application!

Thanks!

Kevin

.
 
I don't know what caused the problem, but I have solved it
to the point where it is behaving the way I want. The
multiselect property was set to Extended. I changed it to
none. In this field, I don't want them selecting multiples
anyway. What I don't understand is there are two other
almost identical fields on the form. These have the
multiselect property set to Extended and everything works
as expected!

The only other thing I can think of is maybe there is some
corruption somewhere that is causing the problem. I may
replace the field with an identical one just in case.

Thanks again for the help!

Kevin
-----Original Message-----
Hi Kevin,

You need to post your code so we don't have to guess at what might be wrong
:-)


--
Sandra Daigle
[Microsoft Access MVP]
For the benefit of others please post all replies to this newsgroup.

Hi there,

I have a list box that is bound to a temporary table in my
frontend application. It is set to Extended multiselect.
If there are ten items in the list and I choose just the
fifth item in the list by double clicking, it selects the
item chosen and all four items above the one choosen in
the list. The code that I have that is supposed to pick
the item choosen, then grabs the very top item in the
list, not the one I was attempting to pick.

This used to work correctly with the properties I have
set. I am not sure what might have changed!

HELP! I need to get this fixed ASAP because I am falling
rapidly behind on delivering this application!

Thanks!

Kevin

.
 
Hi Kevin,

I'm glad you've solved it - I was trying to think of other things that could
be affecting your listboxes and really couldn't come up with anything. The
possibility of corruption crossed my mind too. You could always test that
theory by decompiling or importing all of your objects into a new mdb.
Regardless, I'm glad you have it working as expected now.

--
Sandra Daigle
[Microsoft Access MVP]
For the benefit of others please post all replies to this newsgroup.

I don't know what caused the problem, but I have solved it
to the point where it is behaving the way I want. The
multiselect property was set to Extended. I changed it to
none. In this field, I don't want them selecting multiples
anyway. What I don't understand is there are two other
almost identical fields on the form. These have the
multiselect property set to Extended and everything works
as expected!

The only other thing I can think of is maybe there is some
corruption somewhere that is causing the problem. I may
replace the field with an identical one just in case.

Thanks again for the help!

Kevin
-----Original Message-----
Hi Kevin,

You need to post your code so we don't have to guess at what might
be wrong :-)


--
Sandra Daigle
[Microsoft Access MVP]
For the benefit of others please post all replies to this newsgroup.

Hi there,

I have a list box that is bound to a temporary table in my
frontend application. It is set to Extended multiselect.
If there are ten items in the list and I choose just the
fifth item in the list by double clicking, it selects the
item chosen and all four items above the one choosen in
the list. The code that I have that is supposed to pick
the item choosen, then grabs the very top item in the
list, not the one I was attempting to pick.

This used to work correctly with the properties I have
set. I am not sure what might have changed!

HELP! I need to get this fixed ASAP because I am falling
rapidly behind on delivering this application!

Thanks!

Kevin

.
 
Back
Top