PC Review


Reply
Thread Tools Rate Thread

DTPicker control - Initial date

 
 
René
Guest
Posts: n/a
 
      17th May 2010
I added a date picker (DTPicker1) control on November 30, 2009 in one of my
..xlt template.

At the initial Workbook_Open level of this template, the value of the
"LinkedCell" of the DTPicker1 control is set to "YYYY-MM-DD". Here is the
code:
Sheets("MRF Form").Range("FundingDate") = "YYYY-MM-DD".

My problem is that the first time (and only the first time) a user click on
the down arrow of DTPicker1, the calendar shown is always November 2009 with
the number 30 highlighted.

I would like that the default date of the control would be set to the
current date so the default calendar shown would be the current month date.
How can I fix this issue.

I added the following code at the sheet level but it does not work properly
for the first time.

Private Sub DTPicker1_DropDown()
If Not IsDate(Range("FundingDate").Value) Then DTPicker1.Value = Date
End Sub


Note: I am currently using Excel 2003.


 
Reply With Quote
 
 
 
 
René
Guest
Posts: n/a
 
      19th May 2010
I found the problem. The control was not well initialized at the opening of
the template.
Now the code look like the following line in the Workbook_Open procedure:
Sheets("MRF Form").DTPicker1.Value = Date
Sheets("MRF Form").Range("FundingDate") = "YYYY-MM-DD".

Case closed.

"René" wrote:

> I added a date picker (DTPicker1) control on November 30, 2009 in one of my
> .xlt template.
>
> At the initial Workbook_Open level of this template, the value of the
> "LinkedCell" of the DTPicker1 control is set to "YYYY-MM-DD". Here is the
> code:
> Sheets("MRF Form").Range("FundingDate") = "YYYY-MM-DD".
>
> My problem is that the first time (and only the first time) a user click on
> the down arrow of DTPicker1, the calendar shown is always November 2009 with
> the number 30 highlighted.
>
> I would like that the default date of the control would be set to the
> current date so the default calendar shown would be the current month date.
> How can I fix this issue.
>
> I added the following code at the sheet level but it does not work properly
> for the first time.
>
> Private Sub DTPicker1_DropDown()
> If Not IsDate(Range("FundingDate").Value) Then DTPicker1.Value = Date
> End Sub
>
>
> Note: I am currently using Excel 2003.
>
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DTPicker GUI highlights date/month control was "created" vs. "toda =?Utf-8?B?c25zZA==?= Microsoft Outlook Form Programming 13 30th May 2006 05:22 PM
DTPicker control dave Microsoft Access Form Coding 0 10th Jan 2005 04:37 AM
Dtpicker problem, any ideas why I can't set my dtpicker control to now() Patrick Gibbons Microsoft Access Forms 2 10th Feb 2004 08:34 PM
dtpicker control =?Utf-8?B?U2NvdHR5?= Microsoft Outlook Form Programming 0 5th Dec 2003 11:46 AM
Re: Calendar control similar to Visual Basic DTPicker control? Natty Gur Microsoft ASP .NET 0 10th Nov 2003 10:34 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:38 PM.