Using datetimepicker default min date and max date is
dtpicker1.mindate = cdate("01/01/2012")
dtpicker1.maxdate = cdate("31/01/2012")
I want to change the min date and max date in datetimepicker at run time.
Button1
i am passing the mindate and maxdate again like
dtpicker1.mindate = cdate("01/02/2012")
dtpicker1.maxdate = cdate("28/02/2012")
But it is showing error as “A value was specified for the MinDate Property that is higher than current value of MaxDate.“
How to solve this problem
Two way to do this:
1) If your default
MinDateandMaxDateis always'01/01/2012'and'31/01/2012'Then you need to define
MaxDatebefore defindingMinDatelike this:2) If your default
MinDateandMaxDateis changed every time then first setMinDatelower than your desiredMaxDateandMaxDatehigher than your desiredMinDatethen you can set
MinDateandMaxDatewhat you want like this: