Home All Groups Group Topic Archive Search About

Why won't DateTimePicker work?

Author
14 Jul 2006 2:28 PM
Kevin
I'm doing something like this:

With frmMain
   .DTPicker1.Value = rs.Fields("MyDate").Value
   .Textbox1.Text = "BlahBlah"
   .ShowDialog()
End With

When the form appears, it has today's date in DTPicker1 instead of
what's in the data record. Data field is of type DateTime in SQL2000,
Date value is in the "Short Date" format.

Author
14 Jul 2006 3:07 PM
Claes Bergefall
Have you turned on option exclicit and option strict?
Are you sure Value returns a DateTime object? (And what is the *exact* value
it returns)

What type is rs btw (I couldn't find anything related to db stuff with a
Fields property or method)?

  /claes

Show quoteHide quote
"Kevin" <kev***@cfl.rr.com> wrote in message
news:n6afb219e7eh9rr4uk1iqg476qf5obvqrv@4ax.com...
> I'm doing something like this:
>
> With frmMain
>   .DTPicker1.Value = rs.Fields("MyDate").Value
>   .Textbox1.Text = "BlahBlah"
>   .ShowDialog()
> End With
>
> When the form appears, it has today's date in DTPicker1 instead of
> what's in the data record. Data field is of type DateTime in SQL2000,
> Date value is in the "Short Date" format.