Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Chef's Kitchen Helper    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
About IIf
Brian Nielsen 
   
4 years ago
Hi all.

Im trying this one "Chef's Kitchen Helper - extended"

At around 09:31 in the video. I need to insert this:
HaveEnough: IIf([ProductDifference]=0, True, False)

And no matter how i insert this line, it gives me this :

The expression you entered contains invalid syntax.
You may have entered an operand without an operator.

When i click ok in the error window. Ii hightlight the 'True' name.

So i simple cannot get any further when access will not accept the line. It is like it will not accept true or false.

Hope any here can help. Else i cannot get any further.
Alex Hedley  @Reply  
           
4 years ago
Does the DB download work ok for you?
Brian Nielsen OP  @Reply  
   
4 years ago
Ohh sorry. You are right.
There is a finished access file also.
Checking it now.
Brian Nielsen OP  @Reply  
   
4 years ago
Hmm.
I have a silver membership.
And to download the file i need a gold membership.

I signed up yesterday. So to early to upgrade for me.

And if i cannot get a simple iif to work.
Then i guess theres no reason for a upgrade either.
Richard Rost  @Reply  
          
4 years ago
Can we see some screen shots?
Brian Nielsen OP  @Reply  
   
4 years ago

Richard Rost  @Reply  
          
4 years ago
Hmmm. Looks OK to me. What's ProductDifference? And can I see the SQL behind your query?
Richard Rost  @Reply  
          
4 years ago
Also, you could do this without the IIF statement. Try:

HaveEnough: [ProductDifference]=0

That statement alone will evaluate to True (-1) or False (0)
Richard Rost  @Reply  
          
4 years ago
You may have a problem because ProductDifference is also a calculated field, so the query might not have calculated it before it tries to evaluate your IIF function. You may need a 2nd query. But try my other suggestion first.
Scott Axton  @Reply  
        
4 years ago
The query looks to me like you have an "O" (oh) not a "0" (zero)  is that the case?
Brian Nielsen OP  @Reply  
   
4 years ago
"You may have a problem because ProductDifference is also a calculated field, so the query might not have calculated it before it tries to evaluate your IIF function. You may need a 2nd query. But try my other suggestion first."

I agree that it is not calculated before hand. But i have followed the film : Made by Abraham Breuer.
And in the film it function perfectly. Then what would the point be seeing the films if i cannot trust them?
The film is at : https://599cd.com/blog/display-article.asp?ID=1439 extended version. At around time 09:31.

- - - - -
"Hmmm. Looks OK to me. What's ProductDifference? And can I see the SQL behind your query?"
When i click SQL. It just comes with the error again. Not sure how else to do this.

- - - - -
Also, you could do this without the IIF statement. Try:
HaveEnough: [ProductDifference]=0
That statement alone will evaluate to True (-1) or False (0)

Thanks. Will try. But im a beginner at access and would like to follow the videos for some time.

- - - - -

So in all. How did he make it function in the film ?
And why will my access not accept the same thing.
Richard Rost  @Reply  
          
4 years ago
I was thinking that too... could just be his font. If he copied and pasted it to the code sample above, then it's definitely a zero.
Richard Rost  @Reply  
          
4 years ago
Brian, I made this video over 2 years ago, so I don't remember every little thing from every video I record. I guarantee you IF IT WORKED in the video, it should still work. You've probably typed something wrong. For example, in the video, at that time index, I have:

HaveEnough: IIF([ProductDifference]>=0,True,False)

And I can see you missed the > sign. So there's one difference. You have to type things EXACTLY as I show them, or they won't work.

Plus, over the last two years, even I've learned more things about Access... and I've learned you don't need to use a function like IIF all the time if the simpler option that I showed you above would work. An in this case, it should.

Since you're a beginner, I would recommend watching some of the other videos that I list on that page in the Links section FIRST before trying to tackle this database. Especially:

Relationships
Aggregate Query
IIF Function
Richard Rost  @Reply  
          
4 years ago
You said it very simply yourself...

"And in the film it function perfectly. Then what would the point be seeing the films if i cannot trust them?"

If it works in the video, then IT WORKS. Take a few steps back and try to figure out what you did differently. OR... start over from scratch.
Brian Nielsen OP  @Reply  
   
4 years ago

Richard Rost  @Reply  
          
4 years ago
Let me see the full column for ProductDifference.
Brian Nielsen OP  @Reply  
   
4 years ago
My bad. I had tried with the > sign. Posted the wrong test picture. So is the same.

And also.

The whole reason i signed up was to get the extended video for the Chef's Kitchen Helper. So we can start use it at our home. After that i would start to see what the site have to offer.

The reason i found that video in the first place is :
I work at a super hospital in Denmark called G'dstrup hospital. There we have a big master kitchen in the basement, a smaller kitchen for visitors and 19 smaller kitchens distributed around the whole hospital for the hospitalized.

The problem now is : That there are around 150 people hired for the 19 smaller kitchens and they can order as they like for ingredients, which creates a big mess. So workers are lazy, some click wrong at buy, but there are also great workers.

And all the hospitalized have their own room and a ipad where they can order whatever they want to eat.So if they make an order then it will be delievered at the nearest 15 minute.

Then i come into the picture. I have the job to create a system where one person stands for ordering of ingredients and to make sure everything is in order, so the waste can get down.

Myself : I have programming knowledge in other languages and had started to test out access and then i would later incorporate it into an excel system that have already been created.

So now you know what it is all about.
Brian Nielsen OP  @Reply  
   
4 years ago

Brian Nielsen OP  @Reply  
   
4 years ago
And also.

Ofcourse it would be better for a system running android or ios.
But the top people at the hospital, prefere using as little money as possible.
At moment they are throwing away food worth hundred of thosunds of Danish Kroner every year.
Which make no logic. But. Welcome to Denmark.
Richard Rost  @Reply  
          
4 years ago
Yeah that makes no sense. I can't see anything wrong with your query. Let me see the SQL for it.
Richard Rost  @Reply  
          
4 years ago

Richard Rost  @Reply  
          
4 years ago
I'm thinking it may be a regional setting? Did you make QtyOnHand and RequiredAmount number values or is one of them accidentally text? Here... try downloading MY VERSION and see if it works for you: Database ZIP File
Brian Nielsen OP  @Reply  
   
4 years ago
Hi ..

I cannot select SQL when there is this error.

And running your file worked flawless. (But still need to know why).

You talk about regional settings. I guess it is with listings and so on.
Do you have a guide kinda on howto set it up.
Kevin Robertson  @Reply  
           
4 years ago
Try replacing the commas (,) with semicolons (;)
Brian Nielsen OP  @Reply  
   
4 years ago
Hi Richard.

You were absolutely right and thanks alot for the help.
It was all about the regional settings and it solved it perfectly. No problems in this area again.

Here is what i did. Hopefully will help others also.

// for windows 10.
// open 'control panel'
// click : 'clock and region'
// click : 'change date, time, or number formats'
// in tab 'formats' click : 'additional settings'
// in tab 'numbers' : click drop-down 'decimal symbol' and change 'comma' to 'punktum'.
// click apply
Richard Rost  @Reply  
          
4 years ago
Glad to help. Regional settings are often a problem. That's one of the reasons I switched to ISO dates.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Chef's Kitchen Helper.
 

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: 4/30/2026 3:51:05 PM. PLT: 4s