Solved

IIf Alias

Posted on 2011-03-23
4
251 Views
Last Modified: 2012-05-11
Hello,
I have a bunch of fields that are requiring "N/A" if the end user hasn't entered any data.  The code I'm using for the source is as follows.
=IIf([Close Date]<=0,"N/A",[Close Date])

Now, this works for numbers but not for text entries.  How can I edit this code to work for text entries?
0
Comment
Question by:napsternova
  • 2
4 Comments
 
LVL 47

Accepted Solution

by:
Dale Fye (Access MVP) earned 250 total points
ID: 35198665
Try the NZ() function.

=NZ([Close Date], "N/A")

This will work if no data has ever been entered, but if data was entered, saved, and then deleted, it probably won't.  In that case, you might try:

= IIF(LEN([Close Date] & "") = 0, "N/A", [Close Date])
0
 
LVL 119

Expert Comment

by:Rey Obrero
ID: 35198728
first, you have to set the Data type of the field to Text, if it is not set as Text.
0
 

Author Closing Comment

by:napsternova
ID: 35198755
Easy as pie.  Thank you soooo much!
0
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 35199107
your welcome
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now