[RESOLVED] Date Time Picker - Remove Time
I have a bunch of datetime pickers on my form.
When I step through my program using F8 I notice that when the dtPicker is not changed by the user it writes a value to the database such as "07/25/2005".
The problem I'm having is that when the user changes the date on the dtPicker it shows up in the program as "07/25/2005 9:40:45AM" which is not working because my database field is not a datetime.
How can I trim the time off the end?
Is there a property that does this or do I have to resort to something like a MID or LEFT function to get the values I want?
Re: Date Time Picker - Remove Time
You should be able to just format it.
VB Code:
DTPicker1.Value = Format(DTPicker1.Value, "mm/dd/yyyy")
Re: Date Time Picker - Remove Time
In design mode, select the date picker. Press F4 to get the Properties window. Scroll all the way to the top of the Props window. There's one called "Custom" click the "..." button that's there (you may have to actualy select the property before it shows I think).
A new dialog screen should pop up. There's a checkmark that controls if the date shoudl be displayed or not. Clear it. Set any other props you want. Click OK (or it may be close, I can't remember off the top of my head.) Yuo should be OK after that. If you are using the .Value property to get the date selected, it may still contain the time, just simply use the Format function to return only the date.
Tg
Re: [RESOLVED] Date Time Picker - Remove Time
Thanks Hack...worked like a charm.
That was such an easy fix I never thought of it!
:thumb: :thumb: :thumb:
Re: [RESOLVED] Date Time Picker - Remove Time
Hi..............
Date Time Picker has its Format property set it to
1 - dtpShortDate
it will give u value of datepicker in mm/dd/yyyy format
I think it will solve your problem. If this is the solution or ur problem then Please let me know ?