Solved

Date Picker Control - Locking/Unlocking

Posted on 2000-03-28
6
428 Views
Last Modified: 2013-12-25
How do you lock/unlock the Date Picker Control?  There is no LOCKED property for the Date Picker Control.

Sheila
0
Comment
Question by:baileys
[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
  • 3
  • 2
6 Comments
 
LVL 20

Expert Comment

by:hes
ID: 2665606
To lock the date use the following

DTPicker1.MaxDate = Now
DTPicker1.MinDate = Now

or instead of Now the date you want it locked to.

To unlock

DTPicker1.MaxDate = "12/31/9999"
DTPicker1.MinDate = "01/01/1601"
0
 

Author Comment

by:baileys
ID: 2665719
That works to lock the control, but I also want to disable the dropdown calendar.

Sheila
0
 
LVL 20

Accepted Solution

by:
hes earned 100 total points
ID: 2665735
dtpicker1.UpDown =True
0
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 
LVL 2

Expert Comment

by:damienm
ID: 2668998
Why don't you set the datepickers enabled property to false.

dtPicker.enabled = false
0
 

Author Comment

by:baileys
ID: 2671518
If I set the enabled to false, the dates are shaded.
0
 

Author Comment

by:baileys
ID: 2671522
Thanks, that worked.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

691 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