Results 1 to 4 of 4
  1. #1
    ccordner is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Nov 2011
    Posts
    65

    Microsoft Date And Time Picker on Form

    Hi

    I have a date and time picker control on a form.

    How do I refer to its value in a query criteria?

    I want the 'DateReported' field in the query to be >= dtpStart.value and <=dtpEnd.value?



    Thanks
    Chris

  2. #2
    lfpm062010 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2013
    Location
    US
    Posts
    415
    Try

    DateReported BETWEEN [Forms]![FormName]![DTPSTART_TEXTBOX] AND [Forms]![FormName]![DTPEND_TEXTBOX]

  3. #3
    ccordner is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Nov 2011
    Posts
    65
    Thanks, but that's not returning any records at all. Not sure why...

  4. #4
    lfpm062010 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2013
    Location
    US
    Posts
    415
    Form must be open or else it will ask you to fill in the value.

    Try this, my guess is that it is consider the textbox to be text not date type.

    DateReported BETWEEN CDate([Forms]![FormName]![DTPSTART_TEXTBOX]) AND CDate([Forms]![FormName]![DTPEND_TEXTBOX])

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Date criteria using between and form date picker
    By killermonkey in forum Queries
    Replies: 3
    Last Post: 03-21-2013, 12:44 PM
  2. Unable to use date time picker
    By jhargram in forum Forms
    Replies: 1
    Last Post: 11-22-2012, 10:07 AM
  3. Access Date and Time Picker
    By jsimard in forum Queries
    Replies: 1
    Last Post: 01-24-2012, 04:04 PM
  4. Access Runtime 2007 Date Time Picker Vista not working
    By sailinxtc in forum Programming
    Replies: 0
    Last Post: 09-17-2008, 12:56 PM
  5. Microsoft Date and Time Picker 6.0
    By That Crazy Hockey Dood in forum Forms
    Replies: 0
    Last Post: 07-25-2007, 03:22 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums