Date Picker

C

chuck

I have date picker on a template but when I go to choose the date the
calendar month is still December. Is they a way for the date picker to be on
the correct month?
 
H

Herb Tyson [MVP]

When you open the template itself (as oppose to creating a new document
based on that template), does a December date show as a placeholder? If it
does, then click the Developer tab and click the Design Mode tool so that
you're in design mode (this is not essential, but it makes it easier to
avoid deleting the whole content control rather than just the placeholder
date). Delete the placeholder date from between the two content control
symbols. Then click away from the date picker. It should now display as
"Click here to enter a date".

Turn Design Mode off, and save the template. When you create a new document
based on the template, the date picker should now display "Click here to
enter a date", and it should default to showing the current date.
 
G

Graham Mayor

If the datepicker is on a userform, then open the template and from the vba
editor select the userform. Right click the userform and select the option
'View code'
and add the following macro

Private Sub UserForm_Initialize()
DTPicker1.Value = Date
End Sub

where DTPicker1 is the name of the date picker object.
If there is already a Private Sub UserForm_Initialize() macro, add the line
to it.
This sets the value of the picker to today's date when the form is opened.


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top