VB Date Time Control

Posted on 2011-04-19
Last Modified: 2012-05-11
Is there a control I can use to set the date and time?  That is only one control to set both the date and time.

I'm currently using the two DTPICKER control to allow my users to select the date and the specific time.

Thanks in advance...
Question by:KnightWhoSaysNi
    LVL 16

    Accepted Solution

    I see where the DTPICKER allows for a Format of Long Date, Short Date, Time, and Custom.  I assume you are using one control with a format of Long Date, and another control with a format of Time.  (I can't be sure, I've never used the DTPICKER).

    The format of Custom will allow you to have both a Date and Time in the control.  You just have to set the Format to Custom and the CustomFormat to "mm/dd/yyyy hh:mm:ss".

    Author Comment

    That does work to display the time and date, but it does not allow you to select the time and date.  

    When the 'Format' property is set to Custom, the dropdown brings up the calendar, which allows you to select the date.

    However, while I was working on a screenshot for you, I figured out something that will work.  If you set the 'Format' property to Custom and change the UpDown property to True, you can change the date and time.

    Thanks for the help.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
    This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
    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…
    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…

    733 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

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now