Results 1 to 9 of 9
  1. #1
    Super Moderator WebGenii's Avatar
    Join Date
    Jan 2001
    Location
    Redcliff, Alberta, Canada
    Posts
    4,066
    Thanks
    2
    Thanked 5 Times in 5 Posts

    Calender Control vs Date Time Picker (Access 2002/

    Here is a little oddity I hadn't run into before. I've attached a graphic showing the Calender Control and the Date/Time Picker. I've used them interchangeably in one of my dbs, because on some forms there wasn't room to display a full calender.
    However, they don't appear to be identical in action.
    When I run a query, selecting records between the date range specified by the controls, using the following criteria:

    Between [Forms]![formname]![StartDateControl] And [Forms]![formname]![EndDateControl]
    Querys using the Calender control return all the desired records. However, when the Date/Time Picker is used - records that are equal to the start date are ignored. But records equal to the end date are returned.
    I've amended my query criteria as follows:
    Between ([Forms]![CostVSBillingReports]![StartDate]-1) And [Forms]![CostVSBillingReports]![EndDate]
    And this returns all records in the range.
    [b]Catharine Richardson (WebGenii)
    WebGenii Home Page
    Moderator: Spreadsheets, Other MS Apps, Presentation Apps, Visual Basic for Apps, Windows Mobile

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Calender Control vs Date Time Picker (Access 2002/

    The DTPicker returns a date + time value. By default, the time value is the time you created the control. This is not changed when the user selects a date! <img src=/S/crazy.gif border=0 alt=crazy width=15 height=15>
    A pure date corresponds to midnight, so if the DTPicker has a non-zero time component, you'll get the behavior you report.

    To remedy this, right-click the DTPicker control in design view, and select DTPicker Object | Properties. Set the time to 0:00, then click OK.

  3. #3
    Super Moderator WebGenii's Avatar
    Join Date
    Jan 2001
    Location
    Redcliff, Alberta, Canada
    Posts
    4,066
    Thanks
    2
    Thanked 5 Times in 5 Posts

    Re: Calender Control vs Date Time Picker (Access 2

    Well, I'll be darned....
    [b]Catharine Richardson (WebGenii)
    WebGenii Home Page
    Moderator: Spreadsheets, Other MS Apps, Presentation Apps, Visual Basic for Apps, Windows Mobile

  4. #4
    Super Moderator WebGenii's Avatar
    Join Date
    Jan 2001
    Location
    Redcliff, Alberta, Canada
    Posts
    4,066
    Thanks
    2
    Thanked 5 Times in 5 Posts

    Re: Calender Control vs Date Time Picker (Access 2

    Oh, and it is sooo tedious trying to make sure that it doesn't automatically default to the last date the control was edited on.

    Unless you have a tip to share about that!
    [b]Catharine Richardson (WebGenii)
    WebGenii Home Page
    Moderator: Spreadsheets, Other MS Apps, Presentation Apps, Visual Basic for Apps, Windows Mobile

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Calender Control vs Date Time Picker (Access 2

    You could set the values of the date-time pickers in code when the form loads, for example:

    Private Sub Form_Load()
    Me.StartDateControl = Date - 7
    Me.EndDateControl = Date
    End Sub

  6. #6
    Super Moderator WebGenii's Avatar
    Join Date
    Jan 2001
    Location
    Redcliff, Alberta, Canada
    Posts
    4,066
    Thanks
    2
    Thanked 5 Times in 5 Posts

    Re: Calender Control vs Date Time Picker (Access 2

    Ok
    This is annoying. I'm trying to pull the selected date from the picker to use in an append query.
    I've tried MyDate: [Forms]![frm_CreateClass]![ClassDate]
    I've also tried creating a text box that uses the picker as its' data source.
    No joy.
    I feel I must be missing something obvious, since the form is working just fine.

    Any suggestions?
    [b]Catharine Richardson (WebGenii)
    WebGenii Home Page
    Moderator: Spreadsheets, Other MS Apps, Presentation Apps, Visual Basic for Apps, Windows Mobile

  7. #7
    Super Moderator WebGenii's Avatar
    Join Date
    Jan 2001
    Location
    Redcliff, Alberta, Canada
    Posts
    4,066
    Thanks
    2
    Thanked 5 Times in 5 Posts

    Re: Calender Control vs Date Time Picker (Access 2

    I'm answering my own question:
    Use
    MyDate: CDate(Forms]![frm_CreateClass]![ClassDate])
    [b]Catharine Richardson (WebGenii)
    WebGenii Home Page
    Moderator: Spreadsheets, Other MS Apps, Presentation Apps, Visual Basic for Apps, Windows Mobile

  8. #8
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Morecambe England, Lancashire, England
    Posts
    105
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Calender Control vs Date Time Picker (Access 2002/

    Hi Catharine,

    I've just been browsing through the posts and saw yours. In queries I use a lot of things like

    Between {Enter the Start Date] and [Enter the end Date]

    The date picker seems to be a much better way. Is it in Access 2000?

    Michael Peak
    Morecambe England

  9. #9
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Calender Control vs Date Time Picker (Access 2002/

    The Calendar control comes with Microsoft Access, so all Access users will have it.
    The Date and Time picker ActiveX control does not come with Access. It is part of the Windows common controls. In order to redistribute it with your database, you must have the developer's license included with products like Visual Basic/Visual Studio Pro or the developer version of Office (2002 and below).

Posting Permissions

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