Page 2 of 2 FirstFirst 12
Results 16 to 19 of 19
  1. #16
    svrich is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Mar 2014
    Posts
    23
    Hi John, sorry for the delay. I've been traveling a lot lately.

    Properties are attached in a screen cap. the Column is highlighted in Orange "P N_ P"

    Click image for larger version. 

Name:	Properties.jpg 
Views:	10 
Size:	149.5 KB 
ID:	16152




    All properties are displayed except "Text Align" which is set as "General"

  2. #17
    John_G is offline VIP
    Windows XP Access 2003
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Hi -

    Try this as the second part of the criteria for Column P N_ P - it gets away from using the Like...

    len(trim(nz(Null," "))) = 0

    This changes a Null to a blank if necessary, then determines the length of the resulting string. If the length is zero, the field is empty, whether it contains a Null, a zero-length string, or a blank.

    John

  3. #18
    svrich is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Mar 2014
    Posts
    23
    So how would I utilize this with my either the check box (True - Display all. False - only show zero-length/Null) or a drop down/multi-select box with similar value set?

    The problem so far with that theory is that the P N_ P field is a text based, not a 0/1. I feel an If/Then should be able to be written to perform a "translation" so to speak. Or am I just thinking bout this the wrong way from the start?

  4. #19
    John_G is offline VIP
    Windows XP Access 2003
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Hi -

    When it comes to referring to the checkbox on the form, the data type of the P N_ P field doesn't matter. The checkbox is a Yes/No or True/False boolean.

    I have made this work with test data, and below are screenshots to show you what I did.

    http://i62.tinypic.com/zilwli.jpg The test data set - the "designation" fileld corresponds to your P N_ P
    http://i62.tinypic.com/2w5uko5.jpg The query that will be opened by the test form
    http://i59.tinypic.com/10hvams.jpg The form for testing - the checkbox is called Show_All_Records
    http://i59.tinypic.com/o9g5eo.jpg The query results with the checkbox selected (all records)
    http://i62.tinypic.com/vy45r7.jpg The query results with the checkbox not selected - only nulls in Designation

    Note that in the query design, there are two criteria, and they are on SEPARATE lines - separate lines because they are combined with OR.

    The SQL for the query is:

    SELECT [Null Test].UserName, [Null Test].Grade, [Null Test].Designation
    FROM [Null Test]
    WHERE [Null Test].Designation Is Null OR [Forms]![Null Test]![Show_All_Records]=True;

    The query SQL can be:

    SELECT [Null Test].UserName, [Null Test].Grade, [Null Test].Designation
    FROM [Null Test]
    WHERE Len(Trim(nz([Designation]," ")))=0 OR [Forms]![Null Test]![Show_All_Records]=True;

    if you are unsure about whether P N_ P contains Nulls, blanks, or zero-length strings.

    HTH

    John

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Values in Source control not updating
    By liam_lost in forum Access
    Replies: 5
    Last Post: 08-05-2013, 01:26 PM
  2. Replies: 6
    Last Post: 06-17-2011, 08:40 AM
  3. Display values in a FORM from table.
    By excelkeechak in forum Forms
    Replies: 3
    Last Post: 05-04-2010, 10:17 AM
  4. Replies: 1
    Last Post: 03-27-2010, 06:13 AM
  5. Control source and calculated values
    By meistersteff in forum Forms
    Replies: 0
    Last Post: 11-23-2007, 07:04 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