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!
Re: Calendars and Date Formats
Welcome to the forums. :)
Try this:
VB Code:
Text1.Text = Format(Calendar1.Value, "dd/mm/yy")
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