Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Use Multi-Select List boxes as query parameter (LATEST only)

Status
Not open for further replies.

hasardeux

IS-IT--Management
Aug 10, 2005
4
MA
Hi,

I have a MultiSelect listbox control on my form. I want to pass the LATEST selected item to a query as a parameter. How do I do this?

NB: By Latest selected item I mean as the example below show:
Listbox values: ALL
04-2004
05-2004
06-2004
07-2004
08-2004
09-2004
10-2004

Now, we suppose that I have selected at the same time:
05-2004
07-2004
09-2004

==> The LATEST selected item which will be as query parameter is in this case:
09-2004
(not on what I have clicked by mouse, but the last one in the list)

Attention: the items in listbox are a "text" form not "Date", and they are ordered alphabitacally.


Thank you very much for your precious and appreciaed helps and advices
 
So, why using a MultiSelect listbox if only one value is relevant ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Hi PHV,

I use MultiSelect listbox for other purposes:
- to pouplate a table I use it for some reports

And in the same time, I want to know the last item selected to use as a query parameter using in another report

I hope I'm clearer now.

Thanks for your precising

Any helps?!!
 
Hi hasardeux,

I agree with PHV, this sounds like a confusing arrangement for your users. However, to answer your question - since you are already processing multi-select listbox items, you are familiar with the ItemsSelected collection and the ItemData property of the multi-select listbox. Take a look also at the Count property of the ItemsSelected collection, Count minus 1 should be the same as the Index of the last item in the collection.

Ken S.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top