Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DTPicker Default Value is Wrong

Status
Not open for further replies.

diwin

Technical User
Nov 29, 2002
218
0
0
CA
I have dtpicker in a form to add a new order. It displays the current date and time (short format) when I open the form, but only the incorrect time of 12:00 AM is the actual value that the control holds. When this is added to the table on submitting the order, it is then read as (can't remember specific date) some date in 1899.
1. Why would the value of the control be 12:00 AM (+ no date)???
2. Why is that in turn read as coming from the year 1899???
 
Hey diwin!... I came across your question looking for an answer to DTPicker myself. DTPicker doesn't have a "default value" that you can put formula's (=Now() ) in. It leaves a bit to be desired.

Anyway, it does have a "value" property. Check to see what yours is, my bet it it is 0 or Dec 30, 1899 12:00:00 AM.

Dates in VB (or VBA) are simply number (doubles to be more exact) the left of the decimal is the number of days after Dec 30, 1899 and the decimal to the right is the number of seconds after midnight (it actually get down to milliseconds I think). So the number 1.1 is Dec 31, 1899 2:24:00 AM (0.1 means 2:24:00 AM)

anyway, hope this helps.

Chris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top