-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I have a demo app in Acc97 that shows how to transfer items back &
forth between 2 list boxes. It also shows how to sort the items. I
used collections and callback routines as the row source for each list
box & sorted the collections. This was just an experiment to see if I
could sort collections. For a small number of items the sort is
lickety-split. The ideal sort is probably an array sort. Here is the
URL to the zip file that holds the demo app:
http://home.earthlink.net/~mgf00/SelectDemo.zip
HTH,
MGFoster:::mgf
Oakland, CA (USA)
-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv
iQA/AwUBP4rmTYechKqOuFEgEQL5XACgsL2XrSL9cfjaVad6Wvti0f nkqHAAoNJ6
YVbh1f6Qkt3790mH+dKM3qAh
=sg9x
-----END PGP SIGNATURE-----
Randy Harris wrote:[color=blue]
> "Bill" <zinck74@hotmail.com> wrote in message
> news:vojv9sml2cnt8a@corp.supernews.com...
>[color=green]
>>I'm trying to create a wizardlike interface using a couple listboxes. I
>>know you've seen it before. You double click on an item in one listbox[/color]
>
> and
>[color=green]
>>it "moves" it to the other. I used to approach it with a table and within
>>the table a yes/no field would determine which box it would be in. An
>>Update statement would be fired changing it from yes to no or vice versa[/color]
>
> and
>[color=green]
>>then refreshing the listboxes. This doesn't seem to scale very well as I
>>would have to create a table for each instance of this technique. Just
>>seems ugly too. So I started using the AddItem and RemoveItem method to[/color]
>
> add
>[color=green]
>>and subtract items from a list box. Well now I've run into another[/color]
>
> problem.
>[color=green]
>>When I open the form the list is in alphabetical order because I initially
>>populate the box with a SQL statement. This is what I want. But if I[/color]
>
> move
>[color=green]
>>the item to the "selected" listbox and then decide to move it back, it[/color]
>
> puts
>[color=green]
>>it at the end of the listbox order and I'd like it to be back at where it
>>was, in alphabetical order. It seems the add and remove item just adds or
>>removes an item from a value list. So I guess my question is (finally!),
>>how does one reorder this so that it's back in alphabetical order? Is[/color]
>
> there
>[color=green]
>>a way? I guess I could reissue a SQL statement with each move back and
>>forth and throw some code in there so that it excludes the items that are
>>already selected, but that seems like it could be terribly inefficient.
>>Should I be approaching this in another way? FYI, I have AccessXP
>>
>>TIA,
>>Bill[/color]
>
>
> Interesting, Bill. I'm working on essentially the identical project at the
> moment, an Ad Hoc query builder. I began keeping both lists in arrays, but
> switched to a table after a bit. The table approach is working extremely
> well. I have a Yes/No field in the table (Included) that I simply check or
> uncheck to move a selection from Available to Included or vice versa. I'm
> using a sequence number to allow ordering in the Included list. Available
> always stays alphabetized because it's RowSource is a sorted query.
>
> The two lists are for the output fields only. I have a continuous subform
> in which the user can specify any number of "WHERE" criteria. I balked
> originally at using the table for the same reason you cite, it seems
> inelegant. But it is working out well, none the less. In addition to
> making the coding quite simple, it makes it very easy to add additional
> Fields to the Available list.
>
> I gave a working prototype of the Query Builder to my boss on Friday. Just
> got an email from him (he's pleased).
>
> Randy
>
>[/color]