Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Access (https://www.askmehelpdesk.com/forumdisplay.php?f=441)
-   -   How do I replace "#Type!" with "?" in relevant field? (https://www.askmehelpdesk.com/showthread.php?t=813106)

  • Jun 18, 2015, 10:39 PM
    sjk633
    How do I replace "#Type!" with "?" in relevant field?
    Using Access 2010, in limited field space on a report, I have reduced relevant name of volunteer offering assistance to first-name & first-letter-of-last-name with the following:-

    =[txtHelpFName] & " " & Left([txtHelpLName],1)

    All works well when the volunteer details have been provided or known. When they are not available, the field populates with "#Type!", which I would like to modify with a simple "?"

    Any suggestions on how this can be achieved? Would an IIF Function work, using the above for the TRUE component of the statement?

    Thank you...
  • Jun 19, 2015, 05:24 AM
    ScottGem
    You are close with the IIF, but the problem appears to be when one or more of the fields is Null. Null is a special value that doesn't mean blank, but rather Nothing. You can trap for Null by changing your expression to:

    =Nz([txtHelpFName],"") & " " & Left(Nz([txtHelpLName]," "),1)

    I include a space in the second Nz so the Left() function doesn't choke on a zero length string.

    If that doesn't work, then you may need to use an IIF to test for Null values.

  • All times are GMT -7. The time now is 03:36 AM.