Results 1 to 2 of 2
  1. #1
    ezybusy is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Nov 2015
    Posts
    119

    Filter does not return null value in reordset

    Hi everyone.


    I need your help for an issue regarding the filtering option of one of my form.

    I have a query based on three (3) table, which i used as the record source for a form that i named "Frm_FertilizerBrand".

    Now i have three (3) combo boxes and two buttons (Search and Clear) which i use to perform filter in order to allow the user to view a set of record based on the value(s) selected from the combo boxes.
    Scenario
    ----------
    1- User select a value from one or all combo boxes
    2- User clicks "Search" button to perform the filter
    3- User click "Clear" to remove filter and show all records

    I have the following Vba code:

    On the button "Search"
    --------------------------
    Private Sub Search_Click()
    DoCmd.OpenForm "Frm_FertilizerBrand", acNormal, , "FertilizerHs Like '" & Me.CboFertilizer & "*' AND Country Like '" & Me.CboCountry & "*' AND ImporterID Like '" & Me.CboCompany & "*'"
    End Sub




    On the button "Clear"
    -----------------------
    Private Sub Clear_Click()
    DoCmd.OpenForm "Frm_FertilizerBrand", acNormal
    DoCmd.ShowAllRecords
    Me.CboFertilizer = Null
    Me.CboCountry = Null
    Me.CboCompany = Null
    End Sub


    The Problem
    --------------
    The issue is the filtering option does not display the the records where one the field has no value (Null).
    Example: when i perform a filter for all Fertilizer_Products in a particular country, the result returned does not include countries where ImporterID is null

    How can i solve this??

  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,771
    Options:

    1. handle the null by calculating a field that returns alternate value and apply filter to that constructed field

    2. include Or Is Null in the filter criteria for each field
    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. Replies: 2
    Last Post: 06-03-2013, 11:02 AM
  2. Return a value of zero for null queries
    By adacpt in forum Access
    Replies: 2
    Last Post: 01-22-2012, 07:41 PM
  3. Return Null as Zero
    By bbshriver in forum Reports
    Replies: 12
    Last Post: 10-19-2010, 01:49 PM
  4. No return on Null values
    By forrestapi in forum Queries
    Replies: 4
    Last Post: 10-18-2010, 08:09 AM
  5. Return 0 instead of null
    By salisbut in forum Queries
    Replies: 1
    Last Post: 08-07-2010, 12:01 PM

Tags for this Thread

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