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

    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:

    01/01/0001 00:00:00

    31/12/9999 23:59:59

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



  2. #2
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Sydney, Australia

    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.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jan 2009

    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