M
Marcel Stoop
The .RemoveItem Methode is not in Supported Access. That's why I used the
Technical Paper writen by Jim Ferguson: "Use Classes to Enhance List and
Combo Boxes in Access 97".
(http://www.fmsinc.com/tpapers/97classes/index.html)
This is a great paper and it almost solved my problems.
According to this paper I have created a class, to build the .RemoveItem /
..AddItem Methode.
Within this class I've managed to create a Public Sub () which stores the
existing Items in List Box Me!lstMyList in the db. I used the SQL Statement:
INSERT INTO (...) VALUES ConcatRowSourceStrings .The variable
ConcatRowSourceStrings points to the Items listed in the Collection
mcolItems.
This works perfectly fine.
Subsequently I created another Public Sub () in this Class which retrieves
the Stored Items in the db, and write them in the Listbox Me!lstMyList
I saved the retrieved Items in a variable sRetItems which I defined as a
String.
With:
mColItems.Add sRetItems , I added the retrieved items to the Collection
mControl.RowSource = ConcatRowSourceStrings(), Putting the retrieved Items
in Me!lstMyList
Also this works perfectly fine.
My Problem is following.
- I have retrieved 4 Items, they are correctly shown in the Listbox
- I want to delete a single Item from the Listbox using the Public
Sub RemoveSelected (.) methode which is also described in the mentioned
technical Paper written by Jim Ferguson.
- If I have a look in the Collection I see that the 4 Items are
there (MsgBox ConcatRowSourceStrings )
- If I count the Items (MsgBox mColItems.Count) I see that it
count just 1 Item
- Deleting an Item doesn't work, nothing happen. When I add A new
Item to the Listbox by using Public Sub (.), I can only remove that specific
item
I Guess, the 4 Retrieved Items are being saved as one String in mcolItems,
rather than 4 single Items.
I would sure appreciate, if somebody could point me in the right direction
how to solve this problem
Thanks
Marcel
Technical Paper writen by Jim Ferguson: "Use Classes to Enhance List and
Combo Boxes in Access 97".
(http://www.fmsinc.com/tpapers/97classes/index.html)
This is a great paper and it almost solved my problems.
According to this paper I have created a class, to build the .RemoveItem /
..AddItem Methode.
Within this class I've managed to create a Public Sub () which stores the
existing Items in List Box Me!lstMyList in the db. I used the SQL Statement:
INSERT INTO (...) VALUES ConcatRowSourceStrings .The variable
ConcatRowSourceStrings points to the Items listed in the Collection
mcolItems.
This works perfectly fine.
Subsequently I created another Public Sub () in this Class which retrieves
the Stored Items in the db, and write them in the Listbox Me!lstMyList
I saved the retrieved Items in a variable sRetItems which I defined as a
String.
With:
mColItems.Add sRetItems , I added the retrieved items to the Collection
mControl.RowSource = ConcatRowSourceStrings(), Putting the retrieved Items
in Me!lstMyList
Also this works perfectly fine.
My Problem is following.
- I have retrieved 4 Items, they are correctly shown in the Listbox
- I want to delete a single Item from the Listbox using the Public
Sub RemoveSelected (.) methode which is also described in the mentioned
technical Paper written by Jim Ferguson.
- If I have a look in the Collection I see that the 4 Items are
there (MsgBox ConcatRowSourceStrings )
- If I count the Items (MsgBox mColItems.Count) I see that it
count just 1 Item
- Deleting an Item doesn't work, nothing happen. When I add A new
Item to the Listbox by using Public Sub (.), I can only remove that specific
item
I Guess, the 4 Retrieved Items are being saved as one String in mcolItems,
rather than 4 single Items.
I would sure appreciate, if somebody could point me in the right direction
how to solve this problem
Thanks
Marcel