473,503 Members | 1,772 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with Multi-Select List Boxes

I'm having a problem with a multi-select list box set to Simple
multi-selection. If multiple items are selected and then I change the items
in the list, the list positions previously selected are still selected. For
example, if the list contains a, b, c, d, and e, and b and c are selected,
and then the list is changed to contain v, w, x, y, z, the w and x items are
selected.

This doesn't happen every time; only intermittently. Even though the items
should be cleared when the rowsource is changed, I added code to explicitly
clear every item and to perform a repaint when the rowsource changes, but it
had no effect.

This clearly must be a glitch in Access. Anyone familiar with it?

Thanks,

Neil
Nov 12 '05 #1
2 2706
Hi Neil

The selected items are maintained as indexes into the list, rather than item
values, so if your change the rowsource I would expect that the items at the
same positions would remain selected.

You say that you "explicitly clear each item", but perhaps that code is not
working properly.

The following should work:

Var vItem as Variant
With YourListbox
For Each vItem in .ItemSelected
.Selected(vItem) = False
Next vItem
End With

You should do this *before* changing the RowSource.

There should be no need to Requery or Repaint.

--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

"Neil Ginsberg" <nr*@nrgconsult.com> wrote in message
news:xK*****************@newsread1.news.pas.earthl ink.net...
I'm having a problem with a multi-select list box set to Simple
multi-selection. If multiple items are selected and then I change the items in the list, the list positions previously selected are still selected. For example, if the list contains a, b, c, d, and e, and b and c are selected,
and then the list is changed to contain v, w, x, y, z, the w and x items are selected.

This doesn't happen every time; only intermittently. Even though the items
should be cleared when the rowsource is changed, I added code to explicitly clear every item and to perform a repaint when the rowsource changes, but it had no effect.

This clearly must be a glitch in Access. Anyone familiar with it?

Thanks,

Neil

Nov 12 '05 #2
Thanks for the note. I found that changing the rowsource actually did clear
the list; but I added the code to explicitly clear the list anyway. In
anycase, I'll try your tip of clearing the list first, before changing the
rowsource and see what happens. Thanks.

Neil
"Graham Mandeno" <Gr************@nomail.please> wrote in message
news:%2******************@TK2MSFTNGP09.phx.gbl...
Hi Neil

The selected items are maintained as indexes into the list, rather than item values, so if your change the rowsource I would expect that the items at the same positions would remain selected.

You say that you "explicitly clear each item", but perhaps that code is not working properly.

The following should work:

Var vItem as Variant
With YourListbox
For Each vItem in .ItemSelected
.Selected(vItem) = False
Next vItem
End With

You should do this *before* changing the RowSource.

There should be no need to Requery or Repaint.

--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

"Neil Ginsberg" <nr*@nrgconsult.com> wrote in message
news:xK*****************@newsread1.news.pas.earthl ink.net...
I'm having a problem with a multi-select list box set to Simple
multi-selection. If multiple items are selected and then I change the items
in the list, the list positions previously selected are still selected.

For
example, if the list contains a, b, c, d, and e, and b and c are selected, and then the list is changed to contain v, w, x, y, z, the w and x items

are
selected.

This doesn't happen every time; only intermittently. Even though the items should be cleared when the rowsource is changed, I added code to

explicitly
clear every item and to perform a repaint when the rowsource changes,

but it
had no effect.

This clearly must be a glitch in Access. Anyone familiar with it?

Thanks,

Neil


Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2864
by: Chung Jiho | last post by:
Hello, We have been deploying our web application over win2k servers. It is written in Python and uses Active Scripting to meet our requirements that it must be ASP application. So far, it was...
1
2300
by: WU FUHENG | last post by:
Today,I found a strange problem in python multi-thread programming.When I used function win32com.client.Dispatch('ADODB.Connection') in primary thread, it was OK. But when I called it in...
0
3745
by: frankenberry | last post by:
I have multi-page tiff files. I need to extract individual frames from the multi-page tiffs and save them as single-page tiffs. 95% of the time I receive multi-page tiffs containing 1 or more black...
2
4829
by: RipTide | last post by:
Background: Using an unsupported/abandoned multi-user multi-database program that uses Access 97 and Jet 3.5. Program itself appears to have been built with PowerBuilder 6.5. Databases reside on...
3
2592
by: dice | last post by:
Hi, In order to use an external api call that requires a function pointer I am currently creating static wrappers to call my objects functions. I want to re-jig this so I only need 1 static...
0
3446
by: pvannie | last post by:
Hello there, I've been trying to install DBD::mysql on Mac OS X Server 10.3 for 2 days, but it still raises error. So I'm going to send this message to ask for help. Any help will be much...
1
2284
by: pvannie | last post by:
Hello there, I've been trying to install DBD::mysql on Mac OS X Server 10.3 for 2 days, but it still raises error. So I'm going to send this message to ask for help. Any help will be much...
19
2577
by: 叮叮当当 | last post by:
hi, all when a email body consist with multipart/alternative, i must know when the boundary ends to parse it, but the email lib have not provide some function to indicate the boundary end,...
7
2520
by: EManning | last post by:
I have an A2003 database linked to SQL Server 2005. My problem is with a popup form with a filtered table as a recordsource. I set the filter with an SQL statement like this: SELECT * FROM...
7
5904
by: Adam01 | last post by:
Im not perl expert with perl, and I am trying to run a server script (that I didnt write). And perl reports: Can't locate IO/Compress/Gzip.pm in @INC (@INC contains:...
0
7076
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7323
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6984
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7453
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5005
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4670
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1507
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
732
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
377
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.