Solved

Date control

Posted on 2000-03-07
5
151 Views
Last Modified: 2010-05-02
I need a control (similiar to the dtPicker) that has the ability to use a calendar to pick a date, or type the date with both input mask and formating that can be allowed to be left blank.  The dtPicker has that annoying check box if you want to leave it blank.  Any other options out there?

Thanks for the gumball mickey!
0
Comment
Question by:JimBre
5 Comments
 
LVL 4

Expert Comment

by:wesleystewart
ID: 2592320
Can you just have a text box on the form along with a calendar control?  In the after_update event of the calendar control you can write its value to the text box.  OR, you user can just type the date in the text box, and use can use it's properties to determine the input mask and/or format.  Whatever process you are driving with your date criteria can be modified to allow a null value in the text box.

This would keep you from having to add another control . . .

Wes
0
 
LVL 18

Accepted Solution

by:
mdougan earned 50 total points
ID: 2592356
I did what wesley first suggests, and it works resonably well.  One very annoying thing about the dtPicker control is that I was trying to set the .Value property in the drop_down event, or the get_focus event (or any of the dtPicker's events) to initialize the calendar to be positioned on the date that I wanted to display.  However, setting the date value in any of the dtPicker's events was too late!  So, I had to set the dtPicker's value in the events of some other control.  

Now, if the user types a date into the textbox I've associated with the dtPicker control, then if it's a valid date, I set the dtPicker's value.  Also, at form load, I give the dtPicker a default value of the current system date, otherwise, it will always display the date that you added the dtPicker to your form!

It's a bit more work, but now I have optional dates, without having to use that horrendous checkbox.
0
 
LVL 1

Expert Comment

by:prozak
ID: 2593170
Check out http://www.shersoft.com/ We use the Calendar Widgets and they have a great date combo that does just what you said.
0
 

Expert Comment

by:vfinn
ID: 2596943
You could try the common controls replacement date time picker
http://www.mvps.org/ccrp/

I'm not sure if this has a fix for your problem but it is better than the default date time picker
0
 

Author Comment

by:JimBre
ID: 2748210
Sorry it took so long to get back to. Thanks for the help.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

770 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