Results 1 to 9 of 9
  1. #1
    CementCarver's Avatar
    CementCarver is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2013
    Location
    Canada
    Posts
    231

    Control Source is Null

    I have a control source field called "License" where I display a license number but I concatenate a letter in the front and an indication of the year at the end. For example: ="SM" & [SMLicence] & "-13"



    But there are records where the License value is null. So in the field displaying this data, there a "SM-13" being displayed. This is very misleading, so I'd like to find out if the value is null, to not display anything.

    How can I display a blank field if the value is null?

    CementCarver

  2. #2
    rzw0wr is offline I will always be a newbie
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Indiana
    Posts
    479
    You might try in you control source,
    Iif([SMLicence] = Null ,"", "SM" & [SMLicence] & " -13")

    That way nothing is stored in your table if you do not have a License number.

    Dale

  3. #3
    CementCarver's Avatar
    CementCarver is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2013
    Location
    Canada
    Posts
    231
    Thanks Dale,

    I'll give that a try......CC

  4. #4
    CementCarver's Avatar
    CementCarver is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2013
    Location
    Canada
    Posts
    231
    Iif([SMLicence] = Null ,"", "SM" & [SMLicence] & " -13") didn't work. The "SM" and the "-13" are still being displayed.

    Any other suggestions.....? CC

  5. #5
    rzw0wr is offline I will always be a newbie
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Indiana
    Posts
    479
    Where are you concatenating the text?
    A form, table, query?

    Dale

  6. #6
    CementCarver's Avatar
    CementCarver is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2013
    Location
    Canada
    Posts
    231
    In a form. Here's the correct line I'm trying now.... =IIf([SMLicence]=Null,"","SM" & [SMLicence] & " -13")

    CC

  7. #7
    rzw0wr is offline I will always be a newbie
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Indiana
    Posts
    479
    try,
    Iif(isnull([SMLicence]) ,"", "SM" & [SMLicence] & " -13")

  8. #8
    CementCarver's Avatar
    CementCarver is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2013
    Location
    Canada
    Posts
    231
    Excellent, that worked. Thanks for your help Dale.

    CementCarver

  9. #9
    rzw0wr is offline I will always be a newbie
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Indiana
    Posts
    479
    My pleasure.

    Dale

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

Similar Threads

  1. Help with Control Source
    By love2waltz in forum Access
    Replies: 1
    Last Post: 05-18-2012, 01:09 PM
  2. Replies: 5
    Last Post: 10-13-2011, 03:36 PM
  3. Dlookup as Control Source
    By alsoto in forum Forms
    Replies: 1
    Last Post: 08-28-2011, 07:05 PM
  4. control source
    By nashr1928 in forum Forms
    Replies: 5
    Last Post: 03-12-2011, 09:31 PM
  5. Control Source
    By sarah54 in forum Access
    Replies: 1
    Last Post: 03-07-2011, 09:00 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