PDA

View Full Version : multiselect listbox and date range



psauber
04-12-2008, 06:19 AM
I attach an MDB that the has the multiselect listbox
control. I would however, like to include on the same form
a criteria for a date range; start date, end date and then
build that into the sql when I run the query.
I would also like to make the "All" stay at the top of the
list box.

Can anyone please help me on these 2 items.

Many thanks

Carl A
04-12-2008, 01:38 PM
I took the liberty of making a few changes to your database. I changed your date field to fldDate and your text boxes Format to Short Date.
This should work.

I liked the way you used a multi-select listbox for a database query. That is one I can add to my ToolBox.
As far as putting All in the top of the lisbox I just fudged it.:)

HTH

psauber
04-12-2008, 02:52 PM
Carl A

Thanks for your reply. Did you attach a database ?
if so I am unable to view it because of my ranking
I beleive. Perhaps you could send it to my private
email address ?

Regards

Carl A
04-12-2008, 03:06 PM
The Database is there and you have 18 post you should be able to view it.

psauber
04-13-2008, 01:00 AM
Hi carl

Managed to get it ventually.
however. just cannot get the dates to work
in combination with All.
Error is
94 Invalid use of null.
If I select All without dates then invalid use of null.
If I select All with filtered date range then they all
pop up.
Would it not be better to dispense with All and to
have a button that says select all ?

Trevor
04-17-2008, 10:15 PM
you could add buttons for : Today, Week, month, year, witch will add to the date from and date to fields Ie if the date is 3/2/09 and you click month button, your date would be from 3/1/09 and date to would be 3/31/09 so the bottons only add for current day, month, week , year, and also allow for the user to enter the dates in the fields manualy
And I do too like your use of the list box with query