Results 1 to 7 of 7
  1. #1
    Join Date
    Feb 2004
    Location
    Newbury, UK
    Posts
    7

    Angry Unanswered: DTPicker Problem

    Hi,

    I am developing a database to use in a training centre and use DTPicker to choose the date that a student wishes to attend.

    The only problem I have is that I cannot get the DTPicker to default to todays' date.

    I'm sure it's a simple solution, but I have tried everything!

    Any help would be much appreciated.

    Many Thanks
    Martyn

  2. #2
    Join Date
    Feb 2003
    Location
    Auckland, NZ
    Posts
    150
    That is strange

    All you have to do is put code in the On_Load Event of the form

    'Today's date and time
    DTPicker.Value = Now

    Today's Date only
    DTPicker.Value = CDate(Format(Now, "dd-MMM-yyyy") & " 00:00:00")
    JJ Kennedy
    Double J IT Solutions
    www.doublejit.co.nz

    VB 6, VB.NET, ASP.NET, MS SQL Server, MySQL, MS Access

  3. #3
    Join Date
    Mar 2004
    Posts
    21

    Question

    Does anyone know how to get the DTPicker control to be recognized using the query builder? I tried using the DTPicker on a form, but couldn't get any of my queries to recognize the Picker field to use as a conditional in the query.
    ---------------------
    Thanks
    David

  4. #4
    Join Date
    Mar 2004
    Posts
    21
    bump
    ---------------------
    Thanks
    David

  5. #5
    Join Date
    Feb 2003
    Location
    Auckland, NZ
    Posts
    150
    I am not to sure about this one but I think because the DateTimePicker is an ActiveX Control it may not pick it up in the query builder.

    When you reference it in the query, how do you do it. Have you tried:

    [Forms]![MyForm]![MyDTPicker].[value]
    JJ Kennedy
    Double J IT Solutions
    www.doublejit.co.nz

    VB 6, VB.NET, ASP.NET, MS SQL Server, MySQL, MS Access

  6. #6
    Join Date
    Mar 2004
    Posts
    21
    I haven't tried manually typing the code in the builder, but when you use the Expression Builder and go to Forms and the form it resides on, the DTPicker fields do not even show up as options.

    Although, if I use VBA coding and reference to the Picker field, my values are passed without any problems. For the query I'm building, I do not know enough VB to right the query in VB.

    I'll try to manually type the code in the query builder and see what results I get.

    Thanks for the reply.
    ---------------------
    Thanks
    David

  7. #7
    Join Date
    Feb 2004
    Location
    Newbury, UK
    Posts
    7
    Originally posted by machado
    That is strange

    All you have to do is put code in the On_Load Event of the form

    'Today's date and time
    DTPicker.Value = Now

    Today's Date only
    DTPicker.Value = CDate(Format(Now, "dd-MMM-yyyy") & " 00:00:00")
    Thanks - Works a treat

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •