Results 1 to 4 of 4

Thread: Date time picker problem

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Dec 2003
    Location
    netherlands
    Posts
    163

    Date time picker problem

    Hello,

    I tried to find a solution, but wasn't able to find one that solved my problem.

    I have a form with several date time pickers. On loading this form the program throws the error below. I can click "continue" and the program continues without an errors. However it is an anoying problem i want to get rid of.

    Additional information: '01/01/0001 00:00:00' is not a valid value for
    'Value'. 'Value' should be between 'MinDate' and 'MaxDate'.
    I tried to set the Custom format
    Code:
    dateTimePicker.Format = DateTimePickerFormat.Custom;
    dateTimePicker.CustomFormat = "dd/MM/yy";
    But this didn't solve the error anyone a tip on this error.

  2. #2
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,531

    Re: Date time picker problem

    Well the error is pretty simple... you're setting it to a date that is outside of the min and max values... format has nothign to do with the issue. Are you setting the .Value of the DTP at any point?

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    38,988

    Re: Date time picker problem

    Also, are you setting the min or max values in the designer? After all, if you set a valid date range, which you can do while designing the form, then you'd need to make sure that the date that is being displayed falls within that range.

    It does kind of sound like you are at least setting a default value, though, because I believe that the DTP defaults to using the current date if you don't explicitly set it to something else, and you certainly aren't getting the current date in that error message.
    My usual boring signature: Nothing

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Dec 2003
    Location
    netherlands
    Posts
    163

    Re: Date time picker problem

    I tried to set the min. and max. date on the DTP in the properties. This doesn't work, the system does not allow me to have a "MinDate" below 01/01/1753. I tried to set the .value in the properties, and by code to today "Now" this doesn't work either.

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