• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Userform DTPicker1 - Do not select date in the future

Villalobos

Active Member
Hello,

I would like to ask that how should I do that if I want that the user can not select a date which is in the future (the DTPicker1 is on an userform), my goal is that would not possible to give a grater date than today.
If the user try to select a date which is in the future get a message with follwing text "Not possible, your selected date is in the future, please try it again!"

Could someone offer me a solution?
 
Hi ,

If by DatePicker , you mean the Microsoft Calendar control , see this file.

Narayan
 

Attachments

  • Book1.xlsm
    13.8 KB · Views: 9
Hi Narayan,

Something is not working for me, please would you be so kind to check my file.
I use the Microsoft Date and Time Picker Control 6.0 (SP6).
 

Attachments

  • Sample.xlsm
    18.7 KB · Views: 4
Hi, Villalobos!
I can't test NARAYANK991's file as it doesn't run on my 2013 version but in your uploaded file try changing this:
Code:
                    .Today
by this:
Code:
                    .Value = Today
Regards!
 
Hello SirJB7,

Thank you for your attention, I tried your advice but unfortunately doesn't work.
Where is the problem?
 

Attachments

  • Sample_2.xlsm
    18.7 KB · Views: 3
Hi ,

If you see the properties of the control , there is a property called MaxDate ; assigning the value of the system date to this will ensure that no future date will be accepted.

See your file now.

Narayan
 

Attachments

  • Sample_2.xlsm
    17.6 KB · Views: 7
Last edited:
Back
Top