-
I have two listboxes - Start Date & End Date, I want to populate these listboxes with dates ranging from today(system date) up to today, next year ie all dates from 08/08/2000 thru 08/08/2001.
Must I just get the system date and in a loop add 1 to the day, check month, check year and add each loop to the listboxes or is there an easier way!!??
-
1) Use a datepicker control instead of the list box
2) dtpStart.value= date will set the first one to the current date.
3) dtpEnd.value = DateAdd("y", 1, Date) will set the end value.
You'll just need to make sure, in code that they dont select beyond the two dates...
-
First time I've used the datepicker - VERY NICE!!!
The only problem I'm having now is binding the datepicker to my table... here's my code..
Set DTPickerStart.DataSource = rsRecord
DTPickerStart.DataField = "start_date"
It's a MS ACCESS database and start_date is set to Date/Time. This worked fine when I was using the listbox. I also set start_date to text in the database, but I still get the error....
"runtime 545 - Unable to bind to field or datamember: start_date"
Must one do something "special" when binding the datepicker!!??
-
If you have to bind the control, set it on the control itself (click on databindings).
-
No luck - still get the same error!!