Results 1 to 9 of 9
  1. #1
    Mbakker71 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Dec 2013
    Posts
    20

    Filter on selected item in combox if not empty

    Hello,



    i've a problem with a query. i've a form with multiple comboboxes so that people can search on multiple items. But now i've user the code

    Code:
    Like Nz([Forms]![frm_Searchfile_admin]![cmbDesignator];"*") Or Is Null Or ""
    but the problem is when i filter he shows also the records that are empty becase the codes are after the ). does someone known an alternative for this code??

    Martijn,
    Holland

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    What do you want? You don't want the records with Null to retrieve?
    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
    Mbakker71 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2013
    Posts
    20
    I've a search form with six comboboxes and a listbox. The listbox is connected with a query. that query is filtered on the comboboxes if the user select a row in one of the comboboxes the query is filtert. but now if the user select a row he shows the selected information and the record that are empty.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    I still don't understand what you want to accomplish. Do you NOT want the 'record that are empty'? If so, then why not just remove the Or Is Null part?
    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
    Mbakker71 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2013
    Posts
    20
    already try it.

    then he shows zero records

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    Still not sure what you need. Maybe the following is relevant.

    If null is possible in field, must handle. Options:

    1. Create fields in query with expression to convert null and apply wildcard filter criteria to that field
    [fieldname] & ""
    or
    Nz([fieldname], "none")

    2. Use Or Is Null as part of the criteria parameter (you already tried and say this is not providing the correct output)
    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
    Mbakker71 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2013
    Posts
    20
    I solved the problem

  8. #8
    Mbakker71 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2013
    Posts
    20
    i see now that er is a new problem. he shows none of the empty records

    i've made a screenshot
    Click image for larger version. 

Name:	Capture.PNG 
Views:	6 
Size:	5.7 KB 
ID:	15646

  9. #9
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    Did you try option 1?
    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. Combox box Item List
    By engr_saud1 in forum Access
    Replies: 1
    Last Post: 04-04-2013, 06:50 AM
  2. Replies: 5
    Last Post: 03-15-2013, 10:53 PM
  3. Condition on the value selected from combox
    By mmahmod in forum Programming
    Replies: 7
    Last Post: 10-25-2012, 12:10 PM
  4. Combo box - Open at last item selected
    By mitchy1111 in forum Programming
    Replies: 2
    Last Post: 10-07-2011, 07:23 AM
  5. Replies: 1
    Last Post: 11-23-2010, 01:30 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