Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Cant get IIF function to work correctly
janne 

10 years ago
Hey.

I have been trying to get this IIF function to work correctly for what i want it to do. But i keep on getting this error message when doing it "The expressions syntax is unvalid" (dont know if my transslation was 100% correct there about the error message).

The thing i want to do is this:
I have a feild called phone and one for cellphone and i want the IIF function to show the cellphone nr first. If it doesnt have a cellphone nr in it I want it to show the phone nr instead. And if i doesnt have a cellphone or a ordinary phone to give me a message "Missing number".

I have tried to use this:

Contakt: IIF(IsNull([Cellphone]),[Phone],"Missing Number")

But that doesnt work. So i tried this:

Contakt: IFF(IsNull([Cellphone]),[Phone],[Cellphone])

But that doesnt work either. Have tried Moore things but nothing can make the IIF function to get anything other than the syntax error message. What am  doing wrong and how should i do this IIF function to make it work?


Reply from Alex Hedley:

IIF Function (Glossary)
=IIF(Condition, Value If True, Value If False)

What is your outcome for 'Contakt', does it show any value?

Checks:
Len(Nz(Me.controlname, "")) = 0
len(string) < 1
string = ""

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/18/2026 2:40:19 AM. PLT: 0s