Results 1 to 3 of 3
  1. #1
    BobG is offline Novice
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Nov 2010
    Posts
    2

    Me.Filter statement problem.

    I have a table that contains amongst others a single string character field. This field called MW will only be empty or contain a W. I also have selectable search parameters that when selected formulate an Me.Filter statement. I am having trouble with a section of the filter statement that causes all records to be displayed for all fields to be be shown where there is or is not a W in the MW field.
    The filter parameter is stored in a variables called txtW and txtNoW
    The Me.Filter used will be Me.Filter = txtW under one condition or Me.Filter = txtNoW under the other where txtW = "MW='W'" and txtNoW = "MW<>'W'"


    The txtW gives me all the fields correctly but the txtNoW does not give me all the records that do not contain a W in the MW field.
    I have also tried IsNull and len<>1 to no avail. I suspect I have a syntax error but I don't know where.
    If would greatly appreciate any help I receive.
    BobG

  2. #2
    maximus's Avatar
    maximus is offline Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2009
    Location
    India
    Posts
    931
    well this is what i understand from your post:
    1) You have a field whose value can be either W or Null.
    2) You would like to filter All the Records that are Null.

    My suggestion is:

    Me.Filter = "IsNull([MW])"
    Me.FilterOn = True

    My Field name is MW.
    This filter will Filter all records which has a Null value.

  3. #3
    BobG is offline Novice
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Nov 2010
    Posts
    2
    Thank-you for your help Maximus.
    BobG

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

Similar Threads

  1. Multiple filter problem.
    By ducecoop in forum Access
    Replies: 2
    Last Post: 10-28-2010, 11:14 AM
  2. Report Filter Problem
    By Imgsolutions in forum Access
    Replies: 2
    Last Post: 07-07-2010, 02:32 PM
  3. Form Filter Causing slight problem
    By cowboy in forum Forms
    Replies: 3
    Last Post: 04-15-2010, 07:32 AM
  4. Problem With IF Statement
    By MuskokaMad in forum Programming
    Replies: 0
    Last Post: 03-14-2010, 05:26 PM
  5. Query filter statement
    By Brian62 in forum Access
    Replies: 1
    Last Post: 02-16-2010, 02:34 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