Results 1 to 4 of 4
  1. #1
    killermonkey is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Mar 2013
    Posts
    20

    Date criteria using between and form date picker

    I'm trying to set up the criteria on a query based off the values in two date picker text boxes on a form. It works beautifully like this



    Between [Forms]![Daily]![cboSDate] And [Forms]![Daily]![cboEDate]

    However I would like all the dates in the query to show up if the the date pickers are left blank.

    I've tried this

    Between "*" & [Forms]![Daily]![cboSDate] & "*" And "*" & [Forms]![Daily]![cboEDate] & "*"

    but get an error every time.

    Any suggestions as to what I might be doing wrong?

    Thank you in advance,

    Tyler

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Your syntax is off, but I don't think that method would work with dates anyway. Try

    Between Nz([Forms]![Daily]![cboSDate], #1/1/2000#) And Nz([Forms]![Daily]![cboEDate], #12/31/2029#)

    or other dates appropriate to your needs.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    killermonkey is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Mar 2013
    Posts
    20
    Paul,


    That worked perfectly, thank you for your help.


    Regards,

    Tyler

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    No problem Tyler.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Another date picker.
    By Rod in forum Code Repository
    Replies: 1
    Last Post: 11-05-2012, 07:53 PM
  2. Replies: 3
    Last Post: 08-21-2012, 03:05 PM
  3. Date picker
    By SFC in forum Forms
    Replies: 2
    Last Post: 02-07-2012, 04:00 PM
  4. Replies: 3
    Last Post: 09-02-2011, 01:12 PM
  5. Date picker
    By BI4K12 in forum Access
    Replies: 1
    Last Post: 06-09-2010, 11:11 AM

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