Link to home
Start Free TrialLog in
Avatar of NewToVBA
NewToVBAFlag for United States of America

asked on

Excel VBA DTPicker

Hello Experts - How to set DTPicker controls such way that the output value will be default current time and date now()  unless user selects thier own date and time? I just need to pick up the selection and use in my code. Couldn't find a straight answer....
cheers, v
Avatar of jppinto
jppinto
Flag of Portugal image

DTPicker.Value = Date()
Avatar of NewToVBA

ASKER

Hi Sid, I tested it and found issues.
The output I with the code is with extended full format, e.g., Tuesday, April ,  no matter what format I define in
the object properties or the code itself, as you suggested. The form behaves pretty erratically, cannot define relation
between the object settings vs those in the code.  Any examples of how to mange that will be greatly appreciated.

Cheers V
Show me the exact code that you are using?

Sid
Hi Sid; I attached a test file pretty much showing what I am after. The objective is to display in the box date and time in format "mm/dd/yy hh:mm". What I get is the extended format, while the output, i.e., DTPicker.value is in the fine. I played with the object settings trying to stay within reasonable range of options, like "mmm/dd/yy", ddd/mm/yy", "yy/mm/dd",etc.,  and got some very strange results, e.g., "45/53/11" etc. I expected to control the format as Excel does anywhere else.

Many thanks, V DTPicker-Test.xls
ASKER CERTIFIED SOLUTION
Avatar of SiddharthRout
SiddharthRout
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Many thanks, Sid!

Bill Gates -  listen to Sid, and fix those stupid MS inconsistences!!
Whoa :)

Bill doesn't need my advice :) I am sure this has already been highlighted to the MS Team. Please note that DTpicker is a vb6 control and vb6 is now dying :( (I love vb6) so I doubt if anything can be or will be done about it.

Sid