Results 1 to 8 of 8
  1. #1
    Eddy Sincere is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jul 2014
    Location
    Carson City, NV
    Posts
    114

    Can't filter by date & combobox, the query comes up blank as soon as I add the combobox criteria

    My database manages controlled documents which are subdivided by responsible departments. I set up a query to filter the documents by their expiry date, i.e. if their review date is less than today's date they are expired. My problem comes when I try to add a combo box to filter by responsible department. As soon as I add it to the query criteria it returns no results.



    I have multiple search forms/queries/reports set up in this fashion and they work fine. The problem seems to be when I use the combo box with the date. That's when I don't get any results. I'm thinking there's some problem with using dates and combo boxes.

    Let me know if you want me to post the db. I'm at my wits end.

    Query With Date Only

    Click image for larger version. 

Name:	Filter01.JPG 
Views:	12 
Size:	57.8 KB 
ID:	18630

    Query Results With Date Only

    Click image for larger version. 

Name:	Filter02.JPG 
Views:	12 
Size:	117.7 KB 
ID:	18631


    Query With Date & Combo Box Criteria

    Click image for larger version. 

Name:	Filter03.JPG 
Views:	12 
Size:	62.5 KB 
ID:	18632

    Form with Combo Box Data
    (Column one is a record number and column 2 is Responsible Department, therefore I have the bound column set to "2". Of course, even if I set it to "1" I get the same results, i.e Nothing.)

    Click image for larger version. 

Name:	Filter04.JPG 
Views:	12 
Size:	165.6 KB 
ID:	18633

  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
    Is DRvw actually a Date/Time type field? Is it formatted to show only month/year but actually has a full date value (at least mmddyyyy)? Recommend avoid formatting fields in query. Do this in reports.

    What are the combobox properties? It should be UNBOUND. Is Rspnsbl a text or number field?
    RowSource
    BoundColumn
    ColumnCount
    ColumnWidths

    Do you have lookups set on fields in tables? http://access.mvps.org/access/lookupfields.htm
    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
    Eddy Sincere is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jul 2014
    Location
    Carson City, NV
    Posts
    114
    Is DRvw actually a Date/Time type field? YES
    Is it formatted to show only month/year but actually has a full date value (at least mmddyyyy)? YES, MM/YYYY is the format

    I removed the format in the table and allowed it to just give me the date as mmddyyyy but it didn't fix anything. Still coming up with a blank query.

  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
    Possibly you read my post before I edited. Might look at again.
    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.

  5. #5
    Eddy Sincere is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jul 2014
    Location
    Carson City, NV
    Posts
    114
    You're correct, I think I opened your response while you were still writing it.

    I changed the date format and made sure the cb was unbound. Rspnsbl is a text field. The Rspnsbl table has a record number field (PK) and then a description field (text).

    So with that in mind, I made sure the combobox is bound to column 2.

    The row source is an SQL search string which directs it to the specific Rspnsbl field, not the entire table.

    Then I closed the DB, reopened and now it's working. I'm not sure what I did that was different, but am thinking it was the date format thing.

    Thanks for the checklist, it helps to have someone remind me of each think because its so easy to overlook one piece that throws whole thing into a spiral.

    Lastly, no, I do not ever use lookups. You guys broke me of that nasty habit right from the start. Thanks!

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Format property setting on date should not have made a difference. Format function could make a difference because it results in a string value.

    Must have been the combobox.
    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.

  7. #7
    Eddy Sincere is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jul 2014
    Location
    Carson City, NV
    Posts
    114
    I think you are correct, it is likely the combobox was pulling from the incorrect table. Such a simple mistake but, that always seems to be the case with me. Thanks for the patience.

    Quick question - When using a date field, do you like to use the date/time auto format? Or, do you prefer to skip the auto format feature and just let people insert the date as a text field?

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    I have textboxes bound to date/time field

    and use InputMask

    99/99/"20"00;0;

    and ValidationRule

    <=Date() Or Is Null
    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. Unbound Combobox Filter By Date Criteria
    By burrina in forum Forms
    Replies: 8
    Last Post: 01-04-2013, 02:24 PM
  2. Filter Using ComboBox For Date Criteria
    By burrina in forum Forms
    Replies: 12
    Last Post: 11-29-2012, 08:02 PM
  3. Replies: 1
    Last Post: 09-06-2011, 01:47 PM
  4. Replies: 0
    Last Post: 08-24-2010, 06:38 PM
  5. Replies: 0
    Last Post: 12-16-2009, 01:14 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