Results 1 to 4 of 4
  1. #1
    wackywoo105 is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2014
    Posts
    34

    Me.filter with datepart from 2 combo boxes?

    Please help

    This works:

    Me.Filter = "DatePart(""m"", [due date])
    =" & Me.Combo382



    This also works (but obviously sets the dates to
    match march 2014):

    Me.Filter = "DatePart(""m"", [due date]) = 3 And
    DatePart(""yyyy"", [due date]) = 2014"

    This however does not
    work:

    Me.Filter = "DatePart(""m"", [due date]) = & Me.Combo378 and
    "DatePart(""yyyy"", [due date]) = & Me.Combo380

    Where am I going
    wrong?
    Last edited by wackywoo105; 03-15-2014 at 06:33 PM.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Right idea to concatenate variable but missing quote marks.

    Me.Filter = "Month([due date]) = " & Me.Combo378 & " And Year([due date]) = " & Me.Combo380
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    wackywoo105 is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2014
    Posts
    34
    Thank you very much. That worked a treat. Is there a thanks button? I did the reputation thing.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    The rep thing is the thanks. Glad it worked.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Filter listbox, using combo boxes
    By EthanMoist in forum Forms
    Replies: 8
    Last Post: 05-22-2013, 11:36 AM
  2. Filter Report by Form using combo boxes
    By TubbzUK in forum Reports
    Replies: 3
    Last Post: 12-11-2012, 01:18 PM
  3. how to filter data using two combo boxes?
    By jasonix in forum Reports
    Replies: 3
    Last Post: 11-21-2011, 03:04 AM
  4. Filter based on two combo boxes.
    By jakeao in forum Programming
    Replies: 1
    Last Post: 05-22-2011, 10:56 AM
  5. Filter form from multiple combo boxes
    By Bird_FAT in forum Programming
    Replies: 6
    Last Post: 05-19-2010, 09:32 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