Results 1 to 3 of 3
  1. #1
    louise is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Apr 2015
    Posts
    112

    Null propagation in a query

    Hello,
    I am trying to create an expression in a query where a field label only appears if the field has a value. I am using the + instead of an & as a way to (try to) do this.

    For example, if the course has a size limit, I want the field to include: <sp><sp>Size Limit:<sp> followed by the value in [maximumsize] if there is one.


    I have tried every permutation I can think of and cannot get it to work. Thanks for any suggestions!


    TryNullProp: [CurrentSemester] & (" Size Limit: "+[MaximumSize])

  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,770
    Is MaximumSize a number field? Try:

    TryNullProp: [CurrentSemester] & (" Size Limit: " + IIf([MaximumSize] Is Null, Null, CStr([MaximumSize]))

    http://allenbrowne.com/QueryPerfIssue.html
    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
    louise is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Apr 2015
    Posts
    112

    Solved

    Quote Originally Posted by June7 View Post
    Is MaximumSize a number field? Try:

    TryNullProp: [CurrentSemester] & (" Size Limit: " + IIf([MaximumSize] Is Null, Null, CStr([MaximumSize]))

    http://allenbrowne.com/QueryPerfIssue.html


    Thanks very much! That did the trick.

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

Similar Threads

  1. Null Query Help
    By cuddles in forum Queries
    Replies: 4
    Last Post: 07-02-2014, 01:53 PM
  2. Query Is Null And >0 (Zero)
    By solsearcher in forum Queries
    Replies: 3
    Last Post: 11-12-2012, 04:40 PM
  3. Replies: 1
    Last Post: 02-23-2012, 02:27 PM
  4. Finding the Max Date and Null Values if Null
    By SpdRacerX in forum Queries
    Replies: 1
    Last Post: 02-03-2012, 06:29 AM
  5. Passing criteria "NULL" or "IS NOT NULL" to a query
    By SgtSaunders69 in forum Forms
    Replies: 1
    Last Post: 12-24-2011, 02:22 AM

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