Results 1 to 3 of 3

Thread: Calendars and Date Formats

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2005
    Posts
    22

    Unhappy Calendars and Date Formats

    Hi, I have created a calendar using the Calendar Control 11.0 option in the toolbox and have linked it to a text box in a user form. However, I cannot get the date to display in European format i.e. dd/mm/yy.

    When I am calculating the difference between 2 dates using the 'datediff' function I keep getting the wrong answer as it thinks the date in the text box is in English format when in fact it is in American format. So if I select August 1st and August 2nd I get the answer 31 instead of 1 as it thinks I am calculating the difference between 8/1 and 8/2 not 1/8 and 2/8 as I need.

    Please help, this is driving me crazy!

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Calendars and Date Formats

    Welcome to the forums.

    Try this:
    VB Code:
    1. Text1.Text = Format(Calendar1.Value, "dd/mm/yy")

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Aug 2005
    Posts
    22

    Re: Calendars and Date Formats

    Thanks - you're a star. I actually tried this yesterday but it didnt work and havejust managed to find out why - in the brackets I was referring to the UserForm and not the actual calendar box itself which was throwing up errors!

    Thanks again

    A

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