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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting Date of Calender Control

Status
Not open for further replies.

simeybt

Programmer
Nov 3, 2003
147
GB
All,
Can anyone tell me how to set the date of the calendar control. I want to be able to set the date of the control to the date pulled back from the database. The idea being that if someone enters the wrong date say by a day that when the go to amend the record they don’t have to "flicking" thought the calendar to reselect the date the calendar will automatically open up at the point when the date was entered. i am using the Microsoft month view control ver 6.0.

Simon

 
Assuming that the date is in a text box you can set the date using this code:

me.YourMonthControlName=me.YourDateTextBoxName

Place this event in the On Current event of your form.

HTH,
Eric
 
I tried putting this code where I unhide the calendar but it throws me up an error." An error occurred in a call to the month view control".

Any other ideas.

P.S. Some of my calendar controls pick up the current date and some seem t be stuck to a certain date when they are open. I can’t see where I set this information.
 
got it sorted,
You must first show the control before you can set the date value. DOH!!!

Simon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top