• Calender Control vs Date Time Picker (Access 2002/

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Calender Control vs Date Time Picker (Access 2002/

    Author
    Topic
    #430479

    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.

    Viewing 2 reply threads
    Author
    Replies
    • #1005270

      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! crazy
      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.

      • #1005281

        Well, I’ll be darned….

      • #1007005

        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!

        • #1007010

          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

    • #1020862

      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?

      • #1020864

        I’m answering my own question:
        Use
        MyDate: CDate(Forms]![frm_CreateClass]![ClassDate])

    • #1021136

      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

      • #1021150

        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).

    Viewing 2 reply threads
    Reply To: Calender Control vs Date Time Picker (Access 2002/

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: