Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ActiveX Calendar- First Day Selection

Status
Not open for further replies.

RiazKhanmohamed

Programmer
Oct 30, 2002
115
I have some Active X calendars which are setup to have a start date of Monday - this is setup through the calendars own property window.

The calendar is on it's own form ,and pops up when a user clicks on a button. the button is next to a textbox containing an optional date. if there is a date, the calendar box displays the date. if not, it displays todays date.

On the forms load event, I have an option where it checks the box and then sets the date (calendarbox.today or calendarbox.value)

However, my problem: If there is no date, and it uses CalendarBox.Today, the first day is at it's default of Sunday, and it only goes to the value of Monday (set by me) when a date is found and put into the calendar (CalendarBox.Value = date)

Please help, it's a little bit annoying, and a bit unusual.
 
Sorry - I've now managed to solve this, but in case anyone ever has the same problem, I'll post my solution.

It appears that by typing CalendarBox.Today, it automatically defaults to Sunday as the first day. All I had to do was change this to say:

CalendarBox.value = Now().

However, this gave me the tomorrows date for some reason. In my database, however, i have two functions that put all dates into formats set by me, so I simply ran the Now() function through my function like so:

CalendarBox.value = FormatMyDate(Now())
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top