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!

DateTimePicker

Status
Not open for further replies.

smeeks

Programmer
Oct 7, 2003
31
US
I am writing this because I know when I read/answer threads I look primarily at the number of replies. If it's a thread that has been replied to....I will generally go on down the line. SO...this is in reference to me jumping the gun earlier and now I am stuck.......my problem:

When you click the down arrow on a DTP control, the ValueChanged event fires even if you don't pick a date in the drop down calender? I only want this event to fire if the user actually picks a different date than was previously in the DTP? Is there another event I should be using. Specifically, some of DTP's don't have an actual date assigned to them (loaded from a Database) when I create them...it's just set to the current date with the checkbox unchecked so the user knows it is not set. When the user picks the control I thought about comparing it(the value) to the actual date....and then I would know if they actually changed the date or not, but it is possible they could change it to a day other than today .....then back to today's date...which would cause this code to fail.

Since then I have found events fire when the user clicks the down arrow on the dtp.....once they actually pick a date from the calendar........I can't find an event that fires.


I am desperate!
 
You can try keeping track of the date that was last selected, and then compare the date the event fire reports. So you would have a variable persisting with the last selected date in it, which you would of course update every time the user actually selected another date.

If the date hasn't change you can exit the sub.

Not sure if this answers your question. Hope so.

terpy
 
Yeah....I had the same idea...but when the user picks an actual date from the drop down calendar....no event fires...so I can never find out what the last date was? Only when they click the down arrow on the dtp do the events fire. A dumb approach in my opinion.

Thanks for the suggestion though!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top