Requery List box?

colinmunnelly

Registered User.
Local time
Today, 15:38
Joined
Feb 26, 2002
Messages
89
I have a multiplke selection list box that passes its value over to a text box. When this is done the user go onto the next record but the list box doesn't reflect what items have been passes to the text box. How do i refresh the selected items in the list box or better still have it show the items previously selected. Hope this is not too confusing.
 
If you are using a multi-select list box, this cannot be bound to anything as a bound field can only store one item of data. If your multi-list box is unbound, the items should stay the same in the list box for all records.
If however, you mean show the items in the listbox that are stored in the textbox then that is a different matter!

You will essentially need to break up the items in the listbox using whatever character as the separator. Access 2000 has a handy Split() function that will do this for you but A97 requires that you hand code it. eg

textbox
----------
1, 3, 6, 8, 9

listbox
--------
1
2
3
4
5
6
7
8
9

you will on the Form_Current event, need to
a) split the textbox string into chunks
b) loop through the listbox values
c) of there is a match then select that value

etc

Is this what you were looking for?
 
Yes sounds like just what im looking for. Is there an example i can see somewhere.

Thanks for your time on this
 
I haven't seen one as yet. Try searching the forum for an example and if no joy, I'll have a crack at knocking up an example (If time permits!)
 
If you open the select keywords form, select some keywords and then open the keywords form, you will see that the values are still selected and do not clear.
 

Users who are viewing this thread

Back
Top Bottom