Learn Microsoft Access Advanced Programming Techniques, Tips and Tricks.

Microsoft Date Time Picker Control


We have learned how to use Calendar Control for easy entry of Date Values into Fields on Form through the earlier Article: Animated Floating Calendar. We have used a single Calendar Control for several Date Fields by moving the Calendar Control automatically near the selected Date Field with unfolding animation.

We have used this method to save space on the Form otherwise we need to place several Calendar Controls linked to each date field on the Form.

Now, we have a better ActiveX Control . . . Microsoft Date Time Picker - a Calendar Control that almost looks like a Combo Box on Form and easy to use.

Learn it's Simple Usage

Let us get into a simple example to learn how to use this Calendar for a Date Field on a Form.

  1. Import the following Objects from C:\Program Files\Microsoft Office\Office11\Samples\Northwind.mdb sample database:
    • Table: Employees
    • Form: Employees
  2. Open the Employees Form in Design View.
  3. Select the Company Info Tab.
  4. Select ActiveX Control. . . from Insert Menu.
  5. Select Microsoft Date and Timer Picker Control from the displayed list and click OK to create a control on the Form.
  6. Move the control near the HireDate Field and resize it as shown on the sample design of the Form given below:

    Few Simple Rules of Date/Time Picker Control.

    We must know few simple rules that go with this Control to use it with Date Fields.

    • We can set the Control Source Property of Date Time Picker to HireDate and remove the existing HireDate Field.
    • The HireDate field cannot be blank. When you make a record current with HireDate Field blank or attempt to add a new record the Date Time Picker will show an Error Message: Can't set value to NULL when CheckBox Property=FALSE.

    The Error message indicates that HireDate field cannot be left blank or you cannot remove Date Value from a field and make it blank unless you set the CheckBox Property of the Date and Time Picker Control to Yes.

    Important Settings.

  7. So, first thing first, ensure that the Date Time Picker Control you have added to the Form is in selected state or click to select it, display the Property Sheet (View - -> Properties or Alt+Enter) of the Calendar Control and change the Control Source Property Value to HireDate and change the CheckBox Property Value to Yes.
    • When you move to a particular record the Calendar will automatically move to the date earlier recorded in the HireDate Field. If you want to change the existing HireDate then move the Calendar to the desired Year and Month and click on the required date.
    • When you move to a record with HireDate Field value NULL the Check-Mark disappears and the HireDate field looks like disabled indicating that it is empty but the field shows the date value of last record accessed. If you click on the drop down control of the Calendar to open it then the date value, shown from last accessed record will be entered into the HireDate field immediately, whether you want it or not. You can remove the CheckMark to empty the field or select correct date from the Calendar to overwrite the wrong value.
    • If you prefer to set Date by incrementing or decrementing individual segment (day/month/year) of the Date value, like you do on a Digital Clock, then you may change the UpDown Property Value to Yes. This will change the Drop-down control of the Calendar to a Spin Button Control and the normal Calendar View will not be available.
    • You may click on the Day Segment of the Date value and use the Spin Button Control of the Date Time Picker to increase or decrease the value to the desired level. Use the same method for Month and Year Values.
  8. You may experiment with the Date Time Picker Control, keeping those points I have mentioned above, to understand the behavior of the Calendar control better.

    Settings for Time Value

  9. If you want to enter Time rather than Date into a field from the Date Time Picker then change the Format Property Value to 2. This will automatically change the UpDown Control to Yes and the Spin Button control appear in place of the drop-down control and these can be used to set each segment (hh:mm:ss AM/PM) of the Time Value individually as explained above for date.


  1. [...] Office toolbars, ribbons, task panes on RO Chrome - Add-in Express Blogs LEARN MS-ACCESS TIPS AND TRICKS - Microsoft Date Time Picker Control LEARN MS-ACCESS TIPS AND TRICKS - Keyboard Shortcuts LEARN MS-ACCESS TIPS AND TRICKS - Database [...]

  2. [...] You should know few things about Date/time Picker control, take a look at the following link: http://www.msaccesstips.com/2010/02/...icker-control/ [...]

  3. […] does appear to be one in Access 2010. http://msaccesstips.com/2010/02/micr...icker-control/ Reply With […]


Comments subject to moderation before publishing.


Subscribe in a reader
Your email address:

Delivered by FeedBurner


Popular Posts

Blog Archive

Powered by Blogger.

Follow by Email


Forms Functions How Tos MS-Access Security Reports Class Module msaccess forms Animations msaccess animation Utilities msaccess controls Access and Internet MS-Access Scurity MS-Access and Internet Array External Links Queries msaccess reports Downloads msaccess tips Accesstips Objects Collection Object Property Event Menus and Toolbars Controls MsaccessLinks Process Controls WithEvents Art Work VBA msaccess How Tos Combo Boxes Dictionary Object Graph Charts List Boxes Query msaccessQuery Calculation Command Buttons Form Report Command Button Data Emails and Alerts RaiseEvent Custom Functions Custom Wizards DOS Commands Data Type Object Reference ms-access functions msaccess functions msaccess graphs msaccess reporttricks Item Key msaccessprocess security advanced Access Security Add Auto-Number Field Type Fields Form Instances Macros Menus Recordset SubForm Top Values Variables msaccess email msaccess menus progressmeter Access2007 Copy Excel Expression Join Methods Microsoft Numbering System Records Security Split Table Time Difference Utility Workgroup Wrapper Classes database function ms-access msaccess wizards reference text tutorial vba code Access Emails and Alerts Access Fields Access How Tos Access Mail Merge Access2003 Accounting Year Action Animation Attachment Binary Numbers Bookmarks Budgeting ChDir Color Palette Conditional Formatting Data Filtering Database Records Defining Pages Diagram Disk Dynamic Lookup Error Handler Export External Filter Formatting Groups Hexadecimal Numbers Import Labels List Logo Macro Mail Merge Main Form Memo Monitoring Octal Numbers Operating System Paste Primary-Key Product Rank Reading Remove Rich Text Sequence SetFocus Summary Tab-Page Tables Union Query User Users Water-Mark Word automatically commands hyperlinks iSeries Date iif msaccess msaccess alerts pdf files restore switch toolbar updating upload