Results 1 to 3 of 3

Thread: [RESOLVED] Date should be between 'MinDate' and 'MaxDate' ?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2009
    Posts
    201

    Resolved [RESOLVED] Date should be between 'MinDate' and 'MaxDate' ?

    Morning all,

    I'm pulling my hair our here, I'm blatently missing something but can't seem to see it...

    I'm trying to display a datetime variable in a textbox using:

    Public Class cTest
    Public Start_Date As DateTime

    Public Class TestForm
    Textbox1.Text = cTest.Start_Date.ToShortDateString

    But I keep getting an Out Of Range Exception Value of '05/09/2018 00:00:00' is not valid for 'Value'. 'Value' should be between 'MinDate' and 'MaxDate'.

    The value is well within the minvalue & maxvalue:

    Console.WriteLine(Date.MinValue)
    01/01/0001 00:00:00

    Console.WriteLine(Date.MaxValue)
    31/12/9999 23:59:59

    Any idea what i'm missing....?

    Thanks

    Dave

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,297

    Re: Date should be between 'MinDate' and 'MaxDate' ?

    There is nothing in the code that you have shown that would cause that error message. The error message suggests that you're setting the Value property of a DateTimePicker. The MinDate and MaxDate the error message mentions are also properties of the DateTimePicker.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jan 2009
    Posts
    201

    Re: Date should be between 'MinDate' and 'MaxDate' ?

    Doh, Doh, Doh!!!! My bad.... I'd some how copied a date picker but named it textbox....! All working as it should now, sorry..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width