?
Solved

Validate a datetimepicker

Posted on 2010-01-11
5
Medium Priority
?
557 Views
Last Modified: 2012-05-08
Hi experts
I need to validate a datetimepicker so that it cannot select a date greater than now or more than 1 year ago, any ideas how i can do this?.
0
Comment
Question by:dizzycat
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 22

Expert Comment

by:plusone3055
ID: 26283653
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 26283833
why don't you set the MinDate and MaxDate properties of the control?
0
 

Author Comment

by:dizzycat
ID: 26286950
ok so now i can set the max date but how can i set the minimum date to date.now - 1 year, whether date.now is today next month or next year?
0
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 2000 total points
ID: 26287060
yourdatefield.mindate = date.today.addyears(-1)
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses
Course of the Month12 days, 5 hours left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question