Changing a Data Time Picker Control

  • Thread starter Thread starter Jazz57
  • Start date Start date
J

Jazz57

Hi everyone

i have 2 Date Time Picker control where i fill the firstdate_var and
seconddate_var.

I have a Add button and then start changing the date from both Date Time
Picker.

i don't understand why is hapenning this.

When i load the form, it shows me today's date (it's OK - it's suposed to
work like that)

when i click on Add Button Date Time Picker 1 gets focus, but it chabges the
date from: 06-12-2007 (today's date) to 30-12-1899 !!!!

this hapens either to Date Time Picker 1 as to Date Time Picker 2.

There is not any kind of format option for those date fields....Neither on
the table, neither in Design view, neither on the Add button code.

Does anybody has any clue of what is going on??? Why that particular date ???

Would apreciate very much all the help anybody can give me


Many thanks in advance
 
On Thu, 6 Dec 2007 07:19:01 -0800, Jazz57

Date math often works by arbitrarily calling some date "day 0" and
then adding from there. MSFT often uses 30-12-1899 as day 0, and today
39422. So if I set the value of your datetime picker to 0, you would
see that date.

So I speculate that either some code sets this value, or the controls
are bound (using the ControlSource property) to some underlying data
with a value of 0.

-Tom.
 
Hi again

I checked the my Table on which the form is based and the "Predefined value"
is set to Date() on both Datetime Picker....

in form, the control source is set to the field i want.

So, i don't see what can be hapening

With those aditional information, can you still help me ??


--
Adriano Santos



"Tom van Stiphout" escreveu:
 
In your Add Button, before setting focus to Date Time Picker1, set its value

Me.DateTimePicker1 = Date()
Me.DateTimePicker1.SetFocus
 
Back
Top