Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2002
    Location
    Belgium
    Posts
    243

    Angry Unanswered: Simple question about DateTimePicker

    Hello folks,

    Can anyone help me with following issue?

    I have a form with a DateTimePicker on it.
    I also have a table with the following layout :
    - ID --> Autonumber
    - PickedDate --> Date/Time

    What I want is very simple.
    When a date is picked from the picker the value should be stored in field 'PickedDate' from the table.
    Everything works fine, except ...

    The (date)value of the Picker is of format dd/mm/yyyy and it is stored in that way as long as my day is greater than 12. If the picked day is equal or less than 12 the picked date is stored as mm/dd/yyyy. (day and month are switched)

    Example:
    I pick November 20th, 2004 --> in table 20/11/2004 is stored
    I pick November 10th, 2004 --> I expect 10/11/2004 is stored, but in fact 11/10/2004 is saved.

    How can I make my date always stored as dd/mm/yyyy ?

    Thanks

  2. #2
    Join Date
    Sep 2003
    Location
    The extremely Royal borough of Kensington, London
    Posts
    778
    Format(dtp1.Value, "MM/DD/YYYY")
    Bessie Braddock: Winston, you are drunk!
    Churchill: And Madam, you are ugly. And tomorrow, I'll be sober, and you will still be ugly.

  3. #3
    Join Date
    Sep 2003
    Location
    The extremely Royal borough of Kensington, London
    Posts
    778
    Pass the DateTimePicker value parameter as Format(dtp1.Value, "MM/DD/YYYY")
    Bessie Braddock: Winston, you are drunk!
    Churchill: And Madam, you are ugly. And tomorrow, I'll be sober, and you will still be ugly.

Posting Permissions

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