Results 1 to 10 of 10
  1. #1
    hawkins is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Jun 2011
    Posts
    82

    Not Displaying a : or ,

    I have a subreport in which I have text boxes that combine two records into one for display. For example, one of the text boxes control sources is
    =[AmpsA] & " : " & [kWA] . If there is no records what so ever it will not display the : by itself but if there is a record and isnt filled with anything, null, it displays the : by itself. I was wondering how I can get it to not display the : if both the records are empty. Any suggestions will be greatly appreciated!

  2. #2
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    =[AmpsA] + " : " + [kWA]

    Should do it

  3. #3
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    =[AmpsA] & iif(not isnull([ampsa]) or not isnull([kwa]) ," : ",null) & [kWA]

    if your only requisite is that one or the other field have a non null value this should only display the : mark if one or the other has data in it.

  4. #4
    ketbdnetbp is offline Competent Performer
    Windows 7 32bit Access 2003
    Join Date
    Mar 2011
    Location
    Midwest
    Posts
    254

    hawkins -

    Not really sure I understand...

    "combine two records into one for display" Are you referring to records or fields?

    If fields, from the same record, you might be able to use...

    =IIF(IsNull([AmpsA])=True And IsNull([kWA])=True,"",[AmpsA] & " : " & [kWA])

    or,

    =IIF(Not IsNull([AmpsA]) And Not IsNull([kWA]),[AmpsA] & " : " & [kWA],"")

    Hope this helps,

    Jim

  5. #5
    hawkins is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Jun 2011
    Posts
    82
    Thanks for the quick replies! Works like a charm thank you!

  6. #6
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    Quote Originally Posted by hawkins View Post
    Thanks for the quick replies! Works like a charm thank you!
    Which one? The one I posted should have worked because of the law of propagation of nulls.

  7. #7
    ketbdnetbp is offline Competent Performer
    Windows 7 32bit Access 2003
    Join Date
    Mar 2011
    Location
    Midwest
    Posts
    254

    Bob-

    Quote Originally Posted by boblarson View Post
    Which one? The one I posted should have worked because of the law of propagation of nulls.
    Can you please explain the "law of propagation of nulls" in some detail or point me to a resource, as I would find that to be very helpful.

    Thanks,

    Jim

  8. #8
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    This might help explain it a bit (it isn't thorough but it does help regarding concatenation):
    http://windowssecrets.com/forums/sho...-concatenation

  9. #9
    ketbdnetbp is offline Competent Performer
    Windows 7 32bit Access 2003
    Join Date
    Mar 2011
    Location
    Midwest
    Posts
    254

    Thanks, Bob..

    Learning new things makes this forum worthwhile and exciting!

    All the best,

    Jim

  10. #10
    hawkins is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Jun 2011
    Posts
    82
    I ended up using, =IIF(IsNull([AmpsA])=True And IsNull([kWA])=True,"",[AmpsA] & " : " & [kWA]) . =[AmpsA] + " : " + [kWA] worked when the fields werent populated but if they were populated i got a #error message. This is most likely an error on my end and not the code. Thanks for the help I really appreciate it!

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

Similar Threads

  1. Displaying queries
    By FadingAPE in forum Access
    Replies: 3
    Last Post: 10-12-2010, 09:10 AM
  2. Query not displaying value
    By cwwaicw311 in forum Queries
    Replies: 5
    Last Post: 03-22-2010, 10:11 AM
  3. Displaying Value and not ID
    By jonny in forum Access
    Replies: 3
    Last Post: 10-19-2009, 08:21 AM
  4. Displaying Time Only
    By Corinne in forum Access
    Replies: 5
    Last Post: 06-24-2009, 09:45 PM
  5. displaying the time 12:00:00 AM
    By kfoyil in forum Access
    Replies: 4
    Last Post: 12-05-2006, 11:02 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